mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Remove callbacks to speed up saving
This commit is contained in:
parent
838d23300b
commit
c0ee49fe88
1 changed files with 3 additions and 2 deletions
|
@ -118,10 +118,11 @@ class DatabaseSession implements CakeSessionHandlerInterface {
|
||||||
$record = compact('id', 'data', 'expires');
|
$record = compact('id', 'data', 'expires');
|
||||||
$record[$this->_model->primaryKey] = $id;
|
$record[$this->_model->primaryKey] = $id;
|
||||||
|
|
||||||
|
$options = array('validate' => false, 'callbacks' => false);
|
||||||
try {
|
try {
|
||||||
return $this->_model->save($record, array('validate' => false));
|
return $this->_model->save($record, $options);
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
return $this->_model->save($record, array('validate' => false));
|
return $this->_model->save($record, $options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue