summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/module.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2010-09-07 18:53:25 -0700
committerTim Almdal <tnalmdal@shaw.ca>2010-09-07 18:53:25 -0700
commit5a26dd542a3cb4974870bcfeec4864d1daa616c4 (patch)
treedede0baa9ba893a4987bffc7ddaf925694e5ddde /modules/gallery/helpers/module.php
parentb6fa33faf789749f4de3f4eadf8832748372c980 (diff)
parentd398651c080c18e4f1bf623548091465dac1d528 (diff)
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers/module.php')
-rw-r--r--modules/gallery/helpers/module.php12
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;
+ }
+ }
}
}