raster pushed a commit to branch master.

http://git.enlightenment.org/website/www.git/commit/?id=27d15794e745d51fff4c4d0f87a1b32a87ad1028

commit 27d15794e745d51fff4c4d0f87a1b32a87ad1028
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Thu Mar 18 12:16:55 2021 +0000

    www - weather - easier debug and maintenance for files
---
 public_html/weather.php | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/public_html/weather.php b/public_html/weather.php
index 48090da2..20ffc770 100644
--- a/public_html/weather.php
+++ b/public_html/weather.php
@@ -11,13 +11,16 @@ function response_code($code, $why)
 function weather_cache_path($lat, $lon)
 {
     $t = time();
-    $d = date('Y-m-d h', $t);
+    $d = date('Y-m-d_h', $t);
     $m = date('i', $t);
 
     // One per coord per 15 mins
-    $file = md5(sprintf("%s Q%d:%.4f:%.4f", $d, $m/15, $lat, $lon));
+    $ky = sprintf("%s-Q%d:%.4f:%.4f.json", $d, $m/15, $lat, $lon, $m);
+    // Use the above filename directly for easier debug.maintenance
+    //$fl = md5($ky);
+    $fl = $ky;
 
-    $path = $_SERVER["DOCUMENT_ROOT"] .'/'. CACHE_PATH . '/'. $file;
+    $path = $_SERVER["DOCUMENT_ROOT"] .'/'. CACHE_PATH . '/'. $fl;
     return $path;
 }
 

-- 


Reply via email to