Bugfix: Poller entries had been executed multiple times

This commit is contained in:
Michael 2017-06-21 03:49:05 +00:00
parent 13c8750c27
commit 7097673fa1
3 changed files with 8 additions and 5 deletions

View file

@ -2124,6 +2124,10 @@ function drop_item($id, $interactive = true) {
$item = $r[0];
if ($item['deleted']) {
return 0;
}
$owner = $item['uid'];
$contact_id = 0;

View file

@ -519,8 +519,8 @@ function notifier_run(&$argv, &$argc){
}
$r1 = q("SELECT `batch`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`name`) AS `name`, ANY_VALUE(`network`) AS `network`
FROM `contact` WHERE `network` = '%s'
AND `uid` = %d AND `rel` != %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` GROUP BY `batch` ORDER BY rand()",
FROM `contact` WHERE `network` = '%s' AND `batch` != ''
AND `uid` = %d AND `rel` != %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` GROUP BY `batch`",
dbesc(NETWORK_DIASPORA),
intval($owner['uid']),
intval(CONTACT_IS_SHARING)
@ -528,8 +528,7 @@ function notifier_run(&$argv, &$argc){
}
$r2 = q("SELECT `id`, `name`,`network` FROM `contact`
WHERE `network` in ( '%s', '%s') AND `uid` = %d AND NOT `blocked` AND NOT `pending` AND NOT `archive`
AND `rel` != %d order by rand() ",
WHERE `network` in ('%s', '%s') AND `uid` = %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `rel` != %d",
dbesc(NETWORK_DFRN),
dbesc(NETWORK_MAIL2),
intval($owner['uid']),

View file

@ -678,7 +678,7 @@ function poller_worker_process() {
$poller_db_duration += (microtime(true) - $stamp);
if ($found) {
$r = q("SELECT * FROM `workerqueue` WHERE `pid` = %d", intval(getmypid()));
$r = q("SELECT * FROM `workerqueue` WHERE `pid` = %d AND NOT `done`", intval(getmypid()));
}
return $r;
}