Follow-on to b507681427 - add a default

value for lock_timeout so that folks who get the latest code but don't
run the upgrader don't get burned by a SQL error.
This commit is contained in:
Bharat Mediratta
2013-01-24 23:48:07 -05:00
parent 4926615cd0
commit e8b7e155d5

View File

@@ -324,7 +324,7 @@ class ORM_MPTT_Core extends ORM {
* Lock the tree to prevent concurrent modification.
*/
protected function lock() {
$timeout = module::get_var("gallery", "lock_timeout");
$timeout = module::get_var("gallery", "lock_timeout", 1);
$result = $this->db->query("SELECT GET_LOCK('{$this->table_name}', $timeout) AS l")->current();
if (empty($result->l)) {
throw new Exception("@todo UNABLE_TO_LOCK_EXCEPTION");