Try to solve loading of csv files

This commit is contained in:
Michael RICOIS 2014-03-24 10:52:51 +00:00
parent 22cb199c6f
commit 50e0a8691e
2 changed files with 5 additions and 3 deletions

View File

@ -33,7 +33,9 @@ class TelechargementController extends Zend_Controller_Action
} }
// Suppression du fichier si le temps de cache est depasse // 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); $dateFile = filemtime($this->path.'/'.$file);
$now = mktime(date('G'), date('i'), date('s'), $now = mktime(date('G'), date('i'), date('s'),
date('m') , date('d'), date('Y')); date('m') , date('d'), date('Y'));
@ -81,7 +83,7 @@ class TelechargementController extends Zend_Controller_Action
*/ */
public function consommationAction() public function consommationAction()
{ {
$this->filetime = 1; $this->filetime = 0;
$request = $this->getRequest(); $request = $this->getRequest();
$start = $request->getParam('start', false); $start = $request->getParam('start', false);

View File

@ -19,7 +19,7 @@ $(document).ready(function(){
ConsoDetails = $('input[name=ConsoDetails]').prop('checked') ? 1 : 0; ConsoDetails = $('input[name=ConsoDetails]').prop('checked') ? 1 : 0;
ConsoMois = $('select[name=ConsoMois]').val(); ConsoMois = $('select[name=ConsoMois]').val();
checkFile(); checkFile();
holdTheInterval = setInterval(checkFile, 4000); holdTheInterval = setInterval(checkFile, 8000);
}); });
function checkFile() { function checkFile() {