From 83f3bb1937f0add28198f61837559e248506f06c Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sat, 22 Sep 2018 16:42:25 -0500 Subject: [PATCH] Fix fast sync try/except, default back to previous behavior. --- resources/lib/library.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/resources/lib/library.py b/resources/lib/library.py index a369c331..7b466aa1 100644 --- a/resources/lib/library.py +++ b/resources/lib/library.py @@ -319,7 +319,13 @@ class Library(threading.Thread): def save_last_sync(self): - time_now = datetime.strptime(self.server['config/server-time'].split(', ', 1)[1], '%d %b %Y %H:%M:%S GMT') - timedelta(minutes=2) + try: + time_now = datetime.strptime(self.server['config/server-time'].split(', ', 1)[1], '%d %b %Y %H:%M:%S GMT') - timedelta(minutes=2) + except Exception as error: + + LOG.error(error) + time_now = datetime.utcnow() - timedelta(minutes=2) + last_sync = time_now.strftime('%Y-%m-%dT%H:%M:%Sz') settings('LastIncrementalSync', value=last_sync) LOG.info("--[ sync/%s ]", last_sync)