mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-19 09:25:11 -04:00
hardcode EXTRACTOR_CHOICES to prevent nondeterministic migrations
This commit is contained in:
parent
0a5b22700c
commit
09553d8340
5 changed files with 44 additions and 19 deletions
|
@ -121,7 +121,7 @@ def snapshot_icons(snapshot) -> str:
|
|||
cache_key = f'{snapshot.pk}-{(snapshot.updated or snapshot.added).timestamp()}-snapshot-icons'
|
||||
|
||||
def calc_snapshot_icons():
|
||||
from core.models import EXTRACTOR_CHOICES
|
||||
from core.models import ArchiveResult
|
||||
# start = datetime.now(timezone.utc)
|
||||
|
||||
archive_results = snapshot.archiveresult_set.filter(status="succeeded", output__isnull=False)
|
||||
|
@ -147,12 +147,12 @@ def snapshot_icons(snapshot) -> str:
|
|||
# Missing specific entry for WARC
|
||||
|
||||
extractor_outputs = defaultdict(lambda: None)
|
||||
for extractor, _ in EXTRACTOR_CHOICES:
|
||||
for extractor, _ in ArchiveResult.EXTRACTOR_CHOICES:
|
||||
for result in archive_results:
|
||||
if result.extractor == extractor and result:
|
||||
extractor_outputs[extractor] = result
|
||||
|
||||
for extractor, _ in EXTRACTOR_CHOICES:
|
||||
for extractor, _ in ArchiveResult.EXTRACTOR_CHOICES:
|
||||
if extractor not in exclude:
|
||||
existing = extractor_outputs[extractor] and extractor_outputs[extractor].status == 'succeeded' and extractor_outputs[extractor].output
|
||||
# Check filesystsem to see if anything is actually present (too slow, needs optimization/caching)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue