Skip to content

Commit

Permalink
bugfixing scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
joschobart committed Aug 26, 2024
1 parent b0a49f7 commit ecd2ba6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fun_with_flags/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def create_app(test_config=None):
# regular job for challenging friendlies
sched.add_job(scheduler.sensor, "cron", day_of_week="thu", hour=8, minute=15)
# regular job for adding matches to user-db
sched.add_job(scheduler.sensor, "cron", day_of_week="tue", hour=1, minute=35)
sched.add_job(scheduler.sensor, "cron", day_of_week="tue", hour=1, minute=50)
# v--- testing ---v
# sched.add_job(scheduler.sensor, "cron", day_of_week="mon-sun", hour=21, minute=40)
sched.start()
Expand Down
6 changes: 5 additions & 1 deletion fun_with_flags/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ def sensor():
_match_place,
_team_id,
)
except KeyError:
except Exception:
_my_document[_team_id]["fernet_token"] = ""
_couch[_my_doc_name] = _my_document
continue

# Write changements on the history-object to db
Expand Down Expand Up @@ -159,6 +161,8 @@ def sensor():
schedule(_object, "tuesday")

else:
_my_document[_team_id]["fernet_token"] = ""
_couch[_my_doc_name] = _my_document
continue

# Finally delete fernet-token from DB
Expand Down

0 comments on commit ecd2ba6

Please sign in to comment.