summaryrefslogtreecommitdiff
path: root/lib/kolab_sync_backend.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kolab_sync_backend.php')
-rw-r--r--lib/kolab_sync_backend.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/kolab_sync_backend.php b/lib/kolab_sync_backend.php
index e7b4162..3fbf6cb 100644
--- a/lib/kolab_sync_backend.php
+++ b/lib/kolab_sync_backend.php
@@ -843,7 +843,7 @@ class kolab_sync_backend
$synctime = $synctime->format('Ymdhis');
if (!isset($this->modseq[$deviceid]) || !isset($this->modseq[$deviceid][$folderid])
- || !isset($this->modseq[$deviceid][$synctime])
+ || !isset($this->modseq[$deviceid][$folderid][$synctime])
) {
$rcube = rcube::get_instance();
$db = $rcube->get_dbh();
@@ -857,11 +857,11 @@ class kolab_sync_backend
$current = $row['synctime'];
$this->modseq[$deviceid][$folderid][$synctime] = json_decode($row['data']);
- // Cleanup: remove old records (older than 12 hours from the last one)
- if (($row = $db->fetch_assoc()) && $row['synctime'] < $current - 86400) {
+ // Cleanup: remove old records (keep last two)
+ if ($row = $db->fetch_assoc()) {
$db->query("DELETE FROM syncroton_modseq"
." WHERE device_id = ? AND folder_id = ? AND synctime < ?",
- $deviceid, $folderid, $current - 86400);
+ $deviceid, $folderid, $row['synctime']);
}
}
}