diff options
author | mamouneyya <mamoun.diraneyya@gmail.com> | 2010-09-07 08:41:25 +0300 |
---|---|---|
committer | mamouneyya <mamoun.diraneyya@gmail.com> | 2010-09-07 08:41:25 +0300 |
commit | ba950bec0c84a1467aa2545ca815d5af7b0b002b (patch) | |
tree | 307cdacf0ece60ae9b2db94ad43fcf00d769dcfc /modules/gallery/helpers/module.php | |
parent | 9572c664d2bfff0877d4f2062eb0ef6665a109cf (diff) | |
parent | 7c80bc0c3db1ca20ce424a36a05f1337de9e1e31 (diff) |
Merge remote branch 'gallery3/master'
Diffstat (limited to 'modules/gallery/helpers/module.php')
-rw-r--r-- | modules/gallery/helpers/module.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php index ca6651f1..736b6854 100644 --- a/modules/gallery/helpers/module.php +++ b/modules/gallery/helpers/module.php @@ -448,7 +448,17 @@ class module_Core { $cache->module_name = "gallery"; $cache->name = "_cache"; $cache->value = serialize(self::$var_cache); - $cache->save(); + try { + $cache->save(); + } catch (Database_Exception $e) { + // There's a potential race condition here. Don't fail if that happens because it's + // bound to be transient and not a huge deal, but at least put something in the logs. + if (stristr($e->getMessage(), "duplicate entry")) { + Kohana_Log::add("error", "Failed to cache vars"); + } else { + throw $e; + } + } } } |