Skip to content

Commit 2b58cce

Browse files
committed
Attempted to warn on #984 and #1014
1 parent 03eb7e5 commit 2b58cce

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

archivebox/extractors/__init__.py

+16
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from datetime import datetime, timezone
88
from django.db.models import QuerySet
99

10+
from ..core.settings import ERROR_LOG
1011
from ..index.schema import Link
1112
from ..index.sql import write_link_to_sql_index
1213
from ..index import (
@@ -127,10 +128,25 @@ def archive_link(link: Link, overwrite: bool=False, methods: Optional[Iterable[s
127128
# print('{black} X {}{reset}'.format(method_name, **ANSI))
128129
stats['skipped'] += 1
129130
except Exception as e:
131+
# Disabled until https://github.com/ArchiveBox/ArchiveBox/issues/984
132+
# and https://github.com/ArchiveBox/ArchiveBox/issues/1014
133+
# are fixed.
134+
"""
130135
raise Exception('Exception in archive_methods.save_{}(Link(url={}))'.format(
131136
method_name,
132137
link.url,
133138
)) from e
139+
"""
140+
# Instead, use the kludgy workaround from
141+
# https://github.com/ArchiveBox/ArchiveBox/issues/984#issuecomment-1150541627
142+
with open(ERROR_LOG, "a", encoding='utf-8') as f:
143+
command = ' '.join(sys.argv)
144+
ts = datetime.now(timezone.utc).strftime('%Y-%m-%d__%H:%M:%S')
145+
f.write(("\n" + 'Exception in archive_methods.save_{}(Link(url={}))'.format(
146+
method_name,
147+
link.url,
148+
) + "\n"))
149+
#f.write(f"\n> {command}; ts={ts} version={config['VERSION']} docker={config['IN_DOCKER']} is_tty={config['IS_TTY']}\n")
134150

135151
# print(' ', stats)
136152

0 commit comments

Comments
 (0)