diff options
author | chalbertgit <christopherhalbert@yahoo.com> | 2012-11-13 11:51:03 -0500 |
---|---|---|
committer | chalbertgit <christopherhalbert@yahoo.com> | 2012-11-13 11:51:03 -0500 |
commit | b50768142745dc4bfd8a9460c7490ddd00e3b06a (patch) | |
tree | a9625ede83915aac0a1afae53e9f2d9f5f3afde8 | |
parent | 31681bf834d5dc560b9898d9c30903f08ecb1966 (diff) |
[#1907] Added administrative variable to set lock timeout.
-rw-r--r-- | installer/install.sql | 1 | ||||
-rw-r--r-- | modules/gallery/libraries/ORM_MPTT.php | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/installer/install.sql b/installer/install.sql index aee0900c..0156b9db 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -411,6 +411,7 @@ INSERT INTO {vars} VALUES (NULL,'gallery','email_from','unknown@unknown.com'); INSERT INTO {vars} VALUES (NULL,'gallery','email_reply_to','unknown@unknown.com'); INSERT INTO {vars} VALUES (NULL,'gallery','email_line_length','70'); INSERT INTO {vars} VALUES (NULL,'gallery','email_header_separator','s:1:\"\n\";'); +INSERT INTO {vars} VALUES (NULL,'gallery','lock_timeout','1'); INSERT INTO {vars} VALUES (NULL,'gallery','show_user_profiles_to','registered_users'); INSERT INTO {vars} VALUES (NULL,'gallery','extra_binary_paths','/usr/local/bin:/opt/local/bin:/opt/bin'); INSERT INTO {vars} VALUES (NULL,'gallery','timezone',NULL); diff --git a/modules/gallery/libraries/ORM_MPTT.php b/modules/gallery/libraries/ORM_MPTT.php index 534dd13b..ce0b102c 100644 --- a/modules/gallery/libraries/ORM_MPTT.php +++ b/modules/gallery/libraries/ORM_MPTT.php @@ -324,7 +324,8 @@ class ORM_MPTT_Core extends ORM { * Lock the tree to prevent concurrent modification. */ protected function lock() { - $result = $this->db->query("SELECT GET_LOCK('{$this->table_name}', 1) AS l")->current(); + $timeout = module::get_var("gallery", "lock_timeout"); + $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"); } |