]> git.mxchange.org Git - friendica.git/commitdiff
Avoid duplicate postings
authorMichael <heluecht@pirati.ca>
Sun, 27 Sep 2020 13:23:59 +0000 (13:23 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 27 Sep 2020 13:23:59 +0000 (13:23 +0000)
src/Model/Item.php

index 03a62f5849a71edde33d1a994ead71833dd50179..1c307c699dbf203e3588deecda88ba96ba21b5ba 100644 (file)
@@ -1834,6 +1834,11 @@ class Item
 
                if (!in_array($item['verb'], self::ACTIVITIES)) {
                        $item['icid'] = self::insertContent($item);
+                       if (empty($item['icid'])) {
+                               // This most likely happens when identical posts arrives from different sources at the same time
+                               Logger::warning('No content stored, quitting', ['guid' => $item['guid'], 'uri-id' => $item['uri-id'], 'causer-id' => ($item['causer-id'] ?? 0), 'post-type' => $item['post-type'], 'network' => $item['network']]);
+                               return 0;
+                       }
                }
 
                $body = $item['body'];