Ignore pleasewait error in syncher
@@ -3,9 +3,10 @@ from typing import List
from injector import inject, singleton
from .coordinator import Coordinator
-from ..time import Time
-from ..worker import Worker, Trigger
-from ..logger import getLogger
+from backup.time import Time
+from backup.worker import Worker, Trigger
+from backup.logger import getLogger
+from backup.exceptions import PleaseWait
logger = getLogger(__name__)
@@ -20,6 +21,7 @@ class Scyncer(Worker):
self._time = time
async def checkforSync(self):
+ try:
doSync = False
for trigger in self.triggers:
if trigger.check():
@@ -29,3 +31,6 @@ class Scyncer(Worker):
while self.coord.isSyncing():
await self._time.sleepAsync(3)
await self.coord.sync()
+ except PleaseWait:
+ # Ignore this, since it means a sync already started (race condition)
+ pass
