1
0
Fork 0

The worker is now working

This commit is contained in:
Michael Vogel 2015-09-10 23:10:31 +02:00
commit d3a6ebfe7e
5 changed files with 49 additions and 36 deletions

View file

@ -1433,21 +1433,24 @@ if(! function_exists('proc_run')) {
return;
if(count($args) && $args[0] === 'php') {
$argv = $args;
array_shift($argv);
$parameters = json_encode($argv);
$found = q("SELECT `id` FROM `workerqueue` WHERE `parameter` = '%s'",
dbesc($parameters));
if (get_config("system", "worker")) {
$argv = $args;
array_shift($argv);
if (!$found)
q("INSERT INTO `workerqueue` (`parameter`, `created`, `priority`)
VALUES ('%s', '%s', %d)",
dbesc($parameters),
dbesc(datetime_convert()),
intval(0));
$parameters = json_encode($argv);
$found = q("SELECT `id` FROM `workerqueue` WHERE `parameter` = '%s'",
dbesc($parameters));
// return;
if (!$found)
q("INSERT INTO `workerqueue` (`parameter`, `created`, `priority`)
VALUES ('%s', '%s', %d)",
dbesc($parameters),
dbesc(datetime_convert()),
intval(0));
return;
}
$args[0] = ((x($a->config,'php_path')) && (strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
}