proc_run was replaced

This commit is contained in:
Michael
2017-11-05 12:15:53 +00:00
parent da212a28a2
commit 478e363967
41 changed files with 167 additions and 157 deletions
+7 -6
View File
@@ -1,6 +1,7 @@
<?php
use Friendica\Core\Config;
use Friendica\Core\Worker;
function expire_run(&$argv, &$argc){
global $a;
@@ -47,14 +48,14 @@ function expire_run(&$argv, &$argc){
logger('expire: start');
proc_run(array('priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true),
'include/expire.php', 'delete');
Worker::add(array('priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true),
'expire', 'delete');
$r = dba::p("SELECT `uid`, `username` FROM `user` WHERE `expire` != 0");
while ($row = dba::fetch($r)) {
logger('Calling expiry for user '.$row['uid'].' ('.$row['username'].')', LOGGER_DEBUG);
proc_run(array('priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true),
'include/expire.php', (int)$row['uid']);
Worker::add(array('priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true),
'expire', (int)$row['uid']);
}
dba::close($r);
@@ -63,8 +64,8 @@ function expire_run(&$argv, &$argc){
if (is_array($a->hooks) && array_key_exists('expire', $a->hooks)) {
foreach ($a->hooks['expire'] as $hook) {
logger("Calling expire hook for '" . $hook[1] . "'", LOGGER_DEBUG);
proc_run(array('priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true),
'include/expire.php', 'hook', $hook[1]);
Worker::add(array('priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true),
'expire', 'hook', $hook[1]);
}
}