From 7097673fa19d21a631d4d7b22dab9e98382059ae Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 21 Jun 2017 03:49:05 +0000 Subject: [PATCH] Bugfix: Poller entries had been executed multiple times --- include/items.php | 4 ++++ include/notifier.php | 7 +++---- include/poller.php | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/include/items.php b/include/items.php index 8649a1bd1a..31a709fcbf 100644 --- a/include/items.php +++ b/include/items.php @@ -2124,6 +2124,10 @@ function drop_item($id, $interactive = true) { $item = $r[0]; + if ($item['deleted']) { + return 0; + } + $owner = $item['uid']; $contact_id = 0; diff --git a/include/notifier.php b/include/notifier.php index c110984dde..81f55f7101 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -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']), diff --git a/include/poller.php b/include/poller.php index 29a31a96f8..379aadcd67 100644 --- a/include/poller.php +++ b/include/poller.php @@ -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; } -- 2.39.5