mirror of https://github.com/Hoffelhas/autodoist
Add sync delay, to tune the speed of hits on the Todoist API.
parent
f077053bb2
commit
3db98d186f
5
app.json
5
app.json
|
@ -12,5 +12,10 @@
|
|||
"description": "The Todoist label to use for next actions.",
|
||||
"value": "next_action",
|
||||
"required": false
|
||||
},
|
||||
"TODOIST_SYNC_DELAY": {
|
||||
"description": "The number of seconds to wait between syncs.",
|
||||
"value": "5",
|
||||
"required": false
|
||||
}
|
||||
}
|
|
@ -13,6 +13,7 @@ import sys
|
|||
|
||||
API_TOKEN = os.environ.get('TODOIST_API_KEY', None)
|
||||
NEXT_ACTION_LABEL = os.environ.get('TODOIST_NEXT_ACTION_LABEL', 'next_action')
|
||||
SYNC_DELAY = int(os.environ.get('TODOIST_SYNC_DELAY', '5'))
|
||||
TODOIST_VERSION = '5.3'
|
||||
|
||||
|
||||
|
@ -393,7 +394,7 @@ def main():
|
|||
logging.info("*** Data built")
|
||||
mods = singleton.GetProjectMods()
|
||||
if len(mods) == 0:
|
||||
time.sleep(5)
|
||||
time.sleep(SYNC_DELAY)
|
||||
else:
|
||||
logging.info("* Modifications necessary - skipping sleep cycle.")
|
||||
logging.info("** Beginning sync")
|
||||
|
|
Loading…
Reference in New Issue