Prevent unnecessary increment of thread revision value

Fixes #149
This commit is contained in:
Fedor A. Fetisov 2016-12-29 17:35:58 +03:00
parent bc16b7c25f
commit f4ad0a2351

View File

@ -430,15 +430,17 @@ class Thread
); );
// Perform the cleaning // Perform the cleaning
$revision = self::nextRevision(); if (count($rows) > 0) {
foreach ($rows as $row) { $revision = self::nextRevision();
$thread = Thread::createFromDbInfo($row); foreach ($rows as $row) {
$thread->lastRevision = $revision; $thread = Thread::createFromDbInfo($row);
$thread->modified = $now; $thread->lastRevision = $revision;
$thread->closed = $now; $thread->modified = $now;
$thread->state = self::STATE_CLOSED; $thread->closed = $now;
$thread->save(); $thread->state = self::STATE_CLOSED;
unset($thread); $thread->save(false);
unset($thread);
}
} }
// Release the lock // Release the lock