Skip to content

Commit

Permalink
Merge pull request #756 from cakephp/gc-random
Browse files Browse the repository at this point in the history
Use rand() to trigger garbage collection
  • Loading branch information
markstory authored Apr 22, 2020
2 parents 2faf742 + 27141e2 commit 5bec3c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Model/Table/RequestsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function findRecent(Query $query, array $options)
*/
protected function shouldGc()
{
return time() % 100 === 0;
return rand(1, 100) === 100;
}

/**
Expand Down

0 comments on commit 5bec3c4

Please sign in to comment.