diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2010-09-07 18:53:25 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2010-09-07 18:53:25 -0700 |
commit | 5a26dd542a3cb4974870bcfeec4864d1daa616c4 (patch) | |
tree | dede0baa9ba893a4987bffc7ddaf925694e5ddde /modules/gallery/helpers/module.php | |
parent | b6fa33faf789749f4de3f4eadf8832748372c980 (diff) | |
parent | d398651c080c18e4f1bf623548091465dac1d528 (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.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; + } + } } } |