1
0
Fork 0

Lockfile for onepoll, removing old smarty3 cache files.

This commit is contained in:
Michael Vogel 2013-07-19 23:38:23 +02:00
parent edf8bde581
commit 4dcd00cf4b
2 changed files with 15 additions and 2 deletions

View file

@ -57,6 +57,16 @@ function onepoll_run(&$argv, &$argc){
return; return;
} }
// Test
$lockpath = get_config('system','lockpath');
if ($lockpath != '') {
$pidfile = new pidfile($lockpath, 'onepoll'.$contact_id.'.lck');
if($pidfile->is_already_running()) {
logger("onepoll: Already running for contact ".$contact_id);
exit;
}
}
$d = datetime_convert(); $d = datetime_convert();

View file

@ -122,6 +122,9 @@ function poller_run(&$argv, &$argc){
// clear cache for photos // clear cache for photos
clear_cache($a->get_basepath(), $a->get_basepath()."/photo"); clear_cache($a->get_basepath(), $a->get_basepath()."/photo");
// clear smarty cache
clear_cache($a->get_basepath()."/view/smarty3/compiled", $a->get_basepath()."/view/smarty3/compiled");
set_config('system','cache_last_cleared', time()); set_config('system','cache_last_cleared', time());
} }