mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
refactor: cleanup DatabaseHandler::gc()
for session (#9230)
* Removal of unneeded operations/variables * Update system/Session/Handlers/DatabaseHandler.php --------- Co-authored-by: Michal Sniatala <michal@sniatala.pl>
This commit is contained in:
parent
4a7fbd1229
commit
11d97212ed
@ -282,12 +282,9 @@ class DatabaseHandler extends BaseHandler
|
||||
#[ReturnTypeWillChange]
|
||||
public function gc($max_lifetime)
|
||||
{
|
||||
$separator = ' ';
|
||||
$interval = implode($separator, ['', "{$max_lifetime} second", '']);
|
||||
|
||||
return $this->db->table($this->table)->where(
|
||||
'timestamp <',
|
||||
"now() - INTERVAL {$interval}",
|
||||
"now() - INTERVAL {$max_lifetime} second",
|
||||
false
|
||||
)->delete() ? 1 : $this->fail();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user