Bugfix: Poller entries had been executed multiple times
This commit is contained in:
parent
13c8750c27
commit
7097673fa1
|
@ -2124,6 +2124,10 @@ function drop_item($id, $interactive = true) {
|
||||||
|
|
||||||
$item = $r[0];
|
$item = $r[0];
|
||||||
|
|
||||||
|
if ($item['deleted']) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
$owner = $item['uid'];
|
$owner = $item['uid'];
|
||||||
|
|
||||||
$contact_id = 0;
|
$contact_id = 0;
|
||||||
|
|
|
@ -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`
|
$r1 = q("SELECT `batch`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`name`) AS `name`, ANY_VALUE(`network`) AS `network`
|
||||||
FROM `contact` WHERE `network` = '%s'
|
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` ORDER BY rand()",
|
AND `uid` = %d AND `rel` != %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` GROUP BY `batch`",
|
||||||
dbesc(NETWORK_DIASPORA),
|
dbesc(NETWORK_DIASPORA),
|
||||||
intval($owner['uid']),
|
intval($owner['uid']),
|
||||||
intval(CONTACT_IS_SHARING)
|
intval(CONTACT_IS_SHARING)
|
||||||
|
@ -528,8 +528,7 @@ function notifier_run(&$argv, &$argc){
|
||||||
}
|
}
|
||||||
|
|
||||||
$r2 = q("SELECT `id`, `name`,`network` FROM `contact`
|
$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`
|
WHERE `network` in ('%s', '%s') AND `uid` = %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `rel` != %d",
|
||||||
AND `rel` != %d order by rand() ",
|
|
||||||
dbesc(NETWORK_DFRN),
|
dbesc(NETWORK_DFRN),
|
||||||
dbesc(NETWORK_MAIL2),
|
dbesc(NETWORK_MAIL2),
|
||||||
intval($owner['uid']),
|
intval($owner['uid']),
|
||||||
|
|
|
@ -678,7 +678,7 @@ function poller_worker_process() {
|
||||||
$poller_db_duration += (microtime(true) - $stamp);
|
$poller_db_duration += (microtime(true) - $stamp);
|
||||||
|
|
||||||
if ($found) {
|
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;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue