From: martin f. krafft Date: Wed, 24 Mar 2010 20:19:24 +0000 (+0100) Subject: rework logic when to do partial syncs X-Git-Url: https://git.madduck.net/etc/offlineimap.git/commitdiff_plain/2f0acf792cc5b95c5b5ce19f5e68c43c87976a90?ds=inline;pf=etc rework logic when to do partial syncs --- 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