mirror of
https://github.com/nikdoof/NextAction.git
synced 2025-12-13 17:52:17 +00:00
When modifications are necessary, sync immediately rather than waiting for the sleep interval.
This commit is contained in:
@@ -315,11 +315,12 @@ def main():
|
|||||||
logging.debug("Got initial data: %s", json_data)
|
logging.debug("Got initial data: %s", json_data)
|
||||||
a = TodoistData(json_data)
|
a = TodoistData(json_data)
|
||||||
while True:
|
while True:
|
||||||
time.sleep(5)
|
|
||||||
logging.info("** Beginning sync")
|
|
||||||
logging.info("* Generating modifications")
|
|
||||||
mods = a.GetProjectMods()
|
mods = a.GetProjectMods()
|
||||||
logging.info("* Finished generating modifications")
|
if len(mods) == 0:
|
||||||
|
time.sleep(5)
|
||||||
|
else:
|
||||||
|
logging.info("* Modifications necessary - skipping sleep cycle.")
|
||||||
|
logging.info("** Beginning sync")
|
||||||
sync_state = a.GetSyncState()
|
sync_state = a.GetSyncState()
|
||||||
changed_data = DoSyncAndGetUpdated(mods, sync_state).read()
|
changed_data = DoSyncAndGetUpdated(mods, sync_state).read()
|
||||||
logging.debug("Got sync data %s", changed_data)
|
logging.debug("Got sync data %s", changed_data)
|
||||||
|
|||||||
Reference in New Issue
Block a user