-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Treat 403s from Flickr as dead links (#1201)
* Remove Elasticsearch mem limit Can we make this "opt-in" rather than "opt-out"? Impossible to run ES locally for me without removing this * Add per-provider status checks in dead link validation * Add default overrides and unambiguous way of disabling them * Use more descriptive module docstring Co-authored-by: Krystle Salazar <[email protected]> --------- Co-authored-by: Krystle Salazar <[email protected]>
- Loading branch information
1 parent
0f048cd
commit 6cdfb59
Showing
6 changed files
with
53 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
api/catalog/api/utils/check_dead_links/provider_status_mappings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""Per-provider HTTP status mappings for link availability.""" | ||
|
||
from collections import defaultdict | ||
from dataclasses import dataclass | ||
|
||
|
||
@dataclass | ||
class StatusMapping: | ||
unknown: tuple[int] = (429, 403) | ||
live: tuple[int] = (200,) | ||
|
||
|
||
provider_status_mappings = defaultdict( | ||
StatusMapping, | ||
thingiverse=StatusMapping( | ||
# https://github.com/WordPress/openverse/issues/900 | ||
unknown=(429,), | ||
), | ||
flickr=StatusMapping( | ||
# https://github.com/WordPress/openverse/issues/1200 | ||
unknown=(429,), | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
services: | ||
es: | ||
# Memory limit for ES, as it tends to be a memory hoarder | ||
mem_limit: 4294967296 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters