mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-15 15:44:26 -04:00
catch exception on import of old index.json into ArchiveResult
This commit is contained in:
parent
0aea5ed3e8
commit
171bbeb69b
1 changed files with 19 additions and 2 deletions
|
@ -36,8 +36,25 @@ def forwards_func(apps, schema_editor):
|
||||||
|
|
||||||
for extractor in history:
|
for extractor in history:
|
||||||
for result in history[extractor]:
|
for result in history[extractor]:
|
||||||
ArchiveResult.objects.create(extractor=extractor, snapshot=snapshot, cmd=result["cmd"], cmd_version=result["cmd_version"] or 'unknown',
|
try:
|
||||||
start_ts=result["start_ts"], end_ts=result["end_ts"], status=result["status"], pwd=result["pwd"], output=result["output"] or 'null')
|
ArchiveResult.objects.create(
|
||||||
|
extractor=extractor,
|
||||||
|
snapshot=snapshot,
|
||||||
|
pwd=result["pwd"],
|
||||||
|
cmd=result.get("cmd") or [],
|
||||||
|
cmd_version=result.get("cmd_version") or 'unknown',
|
||||||
|
start_ts=result["start_ts"],
|
||||||
|
end_ts=result["end_ts"],
|
||||||
|
status=result["status"],
|
||||||
|
output=result.get("output") or 'null',
|
||||||
|
)
|
||||||
|
except Exception as e:
|
||||||
|
print(
|
||||||
|
' ! Skipping import due to missing/invalid index.json:',
|
||||||
|
out_dir,
|
||||||
|
e,
|
||||||
|
'(open an issue with this index.json for help)',
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def verify_json_index_integrity(snapshot):
|
def verify_json_index_integrity(snapshot):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue