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,6 +430,7 @@ class Thread
); );
// Perform the cleaning // Perform the cleaning
if (count($rows) > 0) {
$revision = self::nextRevision(); $revision = self::nextRevision();
foreach ($rows as $row) { foreach ($rows as $row) {
$thread = Thread::createFromDbInfo($row); $thread = Thread::createFromDbInfo($row);
@ -437,9 +438,10 @@ class Thread
$thread->modified = $now; $thread->modified = $now;
$thread->closed = $now; $thread->closed = $now;
$thread->state = self::STATE_CLOSED; $thread->state = self::STATE_CLOSED;
$thread->save(); $thread->save(false);
unset($thread); unset($thread);
} }
}
// Release the lock // Release the lock
$lock->release(); $lock->release();