Commit 79f8ce12 authored by Fredrik Wendt's avatar Fredrik Wendt

WIP - pausing based on etherpad

parent 37c8f923
......@@ -10,6 +10,8 @@ import sys
from snatcher import snatch_grading_work
development_mode = os.getenv('PYCHARM_HOSTED')
url_to_pause="https://etherpad.wendt.io/p/sdo-snatching/export/txt"
def main():
log = logging.getLogger('wrapper')
......@@ -43,7 +45,11 @@ def main():
log.info(f"Subject: {subject}")
if "III Grading Required" in subject:
log.info("Subject found - let's consider snatching!")
if wait_n_messages_before_snatching <= 0:
if grading_on_pause():
wait_n_messages_before_snatching =- 1
log.info("Not snatching this one, on pause according to Etherpad")
elif wait_n_messages_before_snatching <= 0:
log.info("Yes, it's our time to shine - go go go!")
if snatch_grading_work():
log.info("Got new work, resetting wait to 4")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment