Skip to content

Commit

Permalink
Updated sleep timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
kelockhart committed May 7, 2021
1 parent 1602234 commit 4faa6be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
MAX_NUM_ROWS_DAILY = 2000
MAX_NUM_ROWS_WEEKLY = 5

# Sleep the start of processing if Solr isn't updated (12*60*60 seconds)
SLEEP_TIMEOUT = 43200

# Reschedule sending if there's an error (units=seconds)
MYADS_RESEND_WINDOW = 60*10
# Reschedule sending if there's an error with Solr (units=seconds)
Expand Down
8 changes: 6 additions & 2 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,9 @@ def process_myads(since=None, user_ids=None, user_emails=None, test_send_to=None
else:
arxiv_complete = False
try:
arxiv_complete = _arxiv_ingest_complete(sleep_delay=300, sleep_timeout=36000, admin_email=args.admin_email)
arxiv_complete = _arxiv_ingest_complete(sleep_delay=300,
sleep_timeout=config.get('SLEEP_TIMEOUT', 43200),
admin_email=args.admin_email)
except Exception as e:
logger.warning('arXiv ingest: code failed with an exception: {0}'.format(e))
sys.exit(1)
Expand All @@ -466,7 +468,9 @@ def process_myads(since=None, user_ids=None, user_emails=None, test_send_to=None
else:
astro_complete = False
try:
astro_complete = _astro_ingest_complete(sleep_delay=300, sleep_timeout=36000, admin_email=args.admin_email)
astro_complete = _astro_ingest_complete(sleep_delay=300,
sleep_timeout=config.get('SLEEP_TIMEOUT', 43200),
admin_email=args.admin_email)
except Exception as e:
logger.warning('astro ingest: code failed with an exception: {0}'.format(e))
sys.exit(1)
Expand Down

0 comments on commit 4faa6be

Please sign in to comment.