| 501 | } |
| 502 | |
| 503 | fn classify(&self, fname: &str, req_path: &Path) -> Classification { |
| 504 | if fname == "repomd.xml" { |
| 505 | if req_path.starts_with("repositories/") { |
| 506 | // These are obs |
| 507 | info!("Classification::RepomdXmlFast"); |
| 508 | Classification::RepomdXmlFast |
| 509 | } else { |
| 510 | info!("Classification::RepomdXmlSlow"); |
| 511 | Classification::RepomdXmlSlow |
| 512 | } |
| 513 | } else if fname == "media" |
| 514 | || fname == "products" |
| 515 | || fname == "repoindex.xml" |
| 516 | || fname == "repomd.xml.key" |
| 517 | || fname == "ARCHIVES.gz" |
| 518 | || fname.ends_with("asc") |
| 519 | || fname.ends_with("sha256") |
| 520 | || fname.ends_with("mirrorlist") |
| 521 | || fname.ends_with("metalink") |
| 522 | || fname.ends_with(".repo") |
| 523 | // Arch |
| 524 | || fname.ends_with("Arch.key") |
| 525 | || fname.ends_with("Arch.db") |
| 526 | || fname.ends_with("Arch.db.tar.gz") |
| 527 | || fname.ends_with("Arch.files") |
| 528 | || fname.ends_with("Arch.files.tar.gz") |
| 529 | || fname.ends_with(".sig") |
| 530 | || fname.ends_with(".files") |
| 531 | // Deb |
| 532 | || fname == "Packages" |
| 533 | || fname == "Packages.gz" |
| 534 | || fname == "Release" |
| 535 | || fname == "Release.gpg" |
| 536 | || fname == "Release.key" |
| 537 | || fname == "Sources" |
| 538 | || fname == "Sources.gz" |
| 539 | || fname.ends_with(".dsc") |
| 540 | // Html |
| 541 | || fname.ends_with("html") |
| 542 | || fname.ends_with("js") |
| 543 | || fname.ends_with("css") |
| 544 | // Html assets - we make this metadata because else it's inconsistent between |
| 545 | // MC and DL.O.O |
| 546 | || fname.ends_with("svg") |
| 547 | || fname.ends_with("png") |
| 548 | || fname.ends_with("jpg") |
| 549 | || fname.ends_with("gif") |
| 550 | || fname.ends_with("ttf") |
| 551 | || fname.ends_with("woff") |
| 552 | || fname.ends_with("woff2") |
| 553 | || fname == "favicon.ico" |
| 554 | // -- |
| 555 | // Related to live boots of tumbleweed. |
| 556 | // These are in metadata to get them to sync with the repo prefetch since |
| 557 | // they can change aggressively. |
| 558 | || fname == "config" |
| 559 | // /tumbleweed/repo/oss/boot/x86_64/config is the first req. |
| 560 | // All of these will come after. |