From 50e0a8691eb7355edd04019fee654ba3662ac02d Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 24 Mar 2014 10:52:51 +0000 Subject: [PATCH] Try to solve loading of csv files --- application/controllers/TelechargementController.php | 6 ++++-- public/themes/default/scripts/conso.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/application/controllers/TelechargementController.php b/application/controllers/TelechargementController.php index f1bb85d6c..3bf463b14 100644 --- a/application/controllers/TelechargementController.php +++ b/application/controllers/TelechargementController.php @@ -33,7 +33,9 @@ class TelechargementController extends Zend_Controller_Action } // Suppression du fichier si le temps de cache est depasse - if (file_exists($this->path.'/'.$file)){ + if ( $this->filetime == 0 && file_exists($this->path.'/'.$file) ){ + unlink($this->path.'/'.$file); + } elseif ( file_exists($this->path.'/'.$file) ) { $dateFile = filemtime($this->path.'/'.$file); $now = mktime(date('G'), date('i'), date('s'), date('m') , date('d'), date('Y')); @@ -81,7 +83,7 @@ class TelechargementController extends Zend_Controller_Action */ public function consommationAction() { - $this->filetime = 1; + $this->filetime = 0; $request = $this->getRequest(); $start = $request->getParam('start', false); diff --git a/public/themes/default/scripts/conso.js b/public/themes/default/scripts/conso.js index e94506c95..b7c312091 100644 --- a/public/themes/default/scripts/conso.js +++ b/public/themes/default/scripts/conso.js @@ -19,7 +19,7 @@ $(document).ready(function(){ ConsoDetails = $('input[name=ConsoDetails]').prop('checked') ? 1 : 0; ConsoMois = $('select[name=ConsoMois]').val(); checkFile(); - holdTheInterval = setInterval(checkFile, 4000); + holdTheInterval = setInterval(checkFile, 8000); }); function checkFile() {