- Logger::debug('Processing queue entry', ['id' => $entry['id'], 'type' => $entry['type'], 'object-type' => $entry['object-type'], 'uri' => $entry['object-id'], 'in-reply-to' => $entry['in-reply-to-id']]);
+ if (!self::isProcessable($id)) {
+ Logger::debug('Other queue entries need to be processed first.', ['id' => $id]);
+ return false;
+ }
+
+ if (!empty($entry['wid'])) {
+ $worker = DI::app()->getQueue();
+ $wid = $worker['id'] ?? 0;
+ if ($entry['wid'] != $wid) {
+ $workerqueue = DBA::selectFirst('workerqueue', ['pid'], ['id' => $entry['wid'], 'done' => false]);
+ if (!empty($workerqueue['pid']) && posix_kill($workerqueue['pid'], 0)) {
+ Logger::notice('Entry is already processed via another process.', ['current' => $wid, 'processor' => $entry['wid']]);
+ return false;
+ }
+ }
+ }
+
+ Logger::debug('Processing queue entry', ['id' => $entry['id'], 'type' => $entry['type'], 'object-type' => $entry['object-type'], 'uri' => $entry['object-id'], 'in-reply-to' => $entry['in-reply-to-id'], 'callstack' => System::callstack(20)]);