[gnome-web-www] previous-donors: Keep an hours cache



commit bdb866ba80d5f94439ed8d12ab983593bfbb2b6d
Author: Tobias Mueller <tobiasmue gnome org>
Date:   Fri Jan 25 22:02:00 2013 +0100

    previous-donors: Keep an hours cache

 theme/page-previous-donors.php |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/theme/page-previous-donors.php b/theme/page-previous-donors.php
index 8b4fa99..7bb9d92 100644
--- a/theme/page-previous-donors.php
+++ b/theme/page-previous-donors.php
@@ -24,10 +24,12 @@ foreach (array(
         $cache_name = "fog_donors_file_{$year}_{$level}";
         if (false === ($donors_file = get_transient($cache_name))) {
             $url = dirname(__FILE__) . "/fog_donors/{$year}-{$level}.txt";
-            $donors_file = file_get_contents($url);
-
-            // keeps a 24-hour cache until another HTTP request
-            set_transient($cache_name, $donors_file, 60);
+            if (false === ($donors_file = file_get_contents($url))) {
+                continue;
+            } else {
+                // keeps an hour cache
+                set_transient($cache_name, $donors_file, 60*60*1);
+            }
         }
         $donors[$year][$level] = array();
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]