From 2f0acf792cc5b95c5b5ce19f5e68c43c87976a90 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Wed, 24 Mar 2010 21:19:24 +0100 Subject: [PATCH] rework logic when to do partial syncs --- .offlineimap/helper.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.offlineimap/helper.py b/.offlineimap/helper.py index 15824d2..d7b47d3 100644 --- a/.offlineimap/helper.py +++ b/.offlineimap/helper.py @@ -29,11 +29,10 @@ def should_do_full_sync(): now = int(time.time()) try: - mtime = os.stat(FILE)[stat.ST_MTIME] - except OSError: - mtime = 0 + since = now - os.stat(FILE)[stat.ST_MTIME] + except: + since = INTERVAL + 1 - since = now - mtime if since > INTERVAL: file(FILE, 'wb').close() return True -- 2.39.5