Skip to content

Commit

Permalink
Remove callbacks to speed up saving
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed Jan 23, 2015
1 parent 838d233 commit c0ee49f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Cake/Model/Datasource/Session/DatabaseSession.php
Expand Up @@ -118,10 +118,11 @@ public function write($id, $data) {
$record = compact('id', 'data', 'expires');
$record[$this->_model->primaryKey] = $id;

$options = array('validate' => false, 'callbacks' => false);
try {
return $this->_model->save($record, array('validate' => false));
return $this->_model->save($record, $options);
} catch (PDOException $e) {
return $this->_model->save($record, array('validate' => false));
return $this->_model->save($record, $options);
}
}

Expand Down

0 comments on commit c0ee49f

Please sign in to comment.