]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Contact.php
Issue 9968: Avoid blocking update calls
[friendica.git] / src / Model / Contact.php
index 3b65f2af1ff9f649440f52b2d183c377c44ed2ba..e4cc88240e1e07acafa9cb17449f4d2e0219e045 100644 (file)
@@ -855,7 +855,9 @@ class Contact
                if (!empty($contact['batch']) && !empty($contact['term-date']) && ($contact['term-date'] > DBA::NULL_DATETIME)) {
                        $fields = ['failed' => false, 'term-date' => DBA::NULL_DATETIME, 'archive' => false];
                        $condition = ['uid' => 0, 'network' => Protocol::FEDERATED, 'batch' => $contact['batch'], 'contact-type' => self::TYPE_RELAY];
-                       DBA::update('contact', $fields, $condition);
+                       if (!DBA::exists('contact', array_merge($condition, $fields))) {
+                               DBA::update('contact', $fields, $condition);
+                       }
                }
 
                $condition = ['`id` = ? AND (`term-date` > ? OR `archive`)', $contact['id'], DBA::NULL_DATETIME];