Adding lock file to calc forge cron

master
Nathan Adams 2014-12-27 14:32:15 -06:00
parent 2d814d43e8
commit 01852cd215
1 changed files with 12 additions and 1 deletions

View File

@ -100,10 +100,21 @@ TEXT)) AS size FROM pg_class AS pgc, pg_namespace AS pgn
return $total;
}
$lock_file = Pluf::f('idf_queuecron_lock',
Pluf::f('tmp_folder', '/tmp').'/calcforgecron.lock');
if (file_exists($lock_file)) {
return;
}
file_put_contents($lock_file, time(), LOCK_EX);
require dirname(__FILE__).'/../src/IDF/conf/path.php';
require 'Pluf.php';
Pluf::start(dirname(__FILE__).'/../src/IDF/conf/idf.php');
Pluf_Dispatcher::loadControllers(Pluf::f('idf_views'));
IDF_Views_Admin_getForgeSize(true);
IDF_Views_Admin_getForgeSize(true);
unlink($lock_file);