]> git.mxchange.org Git - friendica.git/commitdiff
Changes after code review
authorMichael <heluecht@pirati.ca>
Thu, 5 May 2022 12:23:44 +0000 (12:23 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 5 May 2022 12:23:44 +0000 (12:23 +0000)
database.sql
doc/database.md
doc/database/db_post-delivery.md
mod/item.php
src/Worker/CleanWorkerQueue.php [deleted file]
src/Worker/Cron.php
static/dbstructure.config.php

index f0d5854623d50b3b0492a1cd92f67e41aa084594..1d632eb3fbfc6e0d9e907ab495b416fc95b90a1b 100644 (file)
@@ -1132,7 +1132,7 @@ CREATE TABLE IF NOT EXISTS `post-delivery` (
        FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
        FOREIGN KEY (`inbox-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
        FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
-) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Status of ActivityPub inboxes';
+) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Delivery data for posts for the batch processing';
 
 --
 -- TABLE post-delivery-data
index 961e8183ab7267c5ecf96d79577f493181c6e503..bd5bef445bae3c938245f9ed5b86719729a1ede2 100644 (file)
@@ -50,7 +50,7 @@ Database Tables
 | [post-category](help/database/db_post-category) | post relation to categories |
 | [post-collection](help/database/db_post-collection) | Collection of posts |
 | [post-content](help/database/db_post-content) | Content for all posts |
-| [post-delivery](help/database/db_post-delivery) | Status of ActivityPub inboxes |
+| [post-delivery](help/database/db_post-delivery) | Delivery data for posts for the batch processing |
 | [post-delivery-data](help/database/db_post-delivery-data) | Delivery data for items |
 | [post-link](help/database/db_post-link) | Post related external links |
 | [post-media](help/database/db_post-media) | Attached media |
index 1937e059a5e43dbce1e2cf9dee85bae6860f5ac7..79e858193a8b26e185c8f28a72a39fcab23bcb72 100644 (file)
@@ -1,7 +1,7 @@
 Table post-delivery
 ===========
 
-Status of ActivityPub inboxes
+Delivery data for posts for the batch processing
 
 Fields
 ------
index 34475188ea61cb27d826722efdc6096a6cb4ff13..71c1568f6d6da105d11053b4951fff8e8c70ff69 100644 (file)
@@ -672,7 +672,8 @@ function item_post(App $a) {
                        'attach' => $datarray['attach'],
                        'file' => $datarray['file'],
                        'edited' => DateTimeFormat::utcNow(),
-                       'changed' => DateTimeFormat::utcNow()];
+                       'changed' => DateTimeFormat::utcNow()
+               ];
 
                Item::update($fields, ['id' => $post_id]);
                Item::updateDisplayCache($datarray['uri-id']);
diff --git a/src/Worker/CleanWorkerQueue.php b/src/Worker/CleanWorkerQueue.php
deleted file mode 100644 (file)
index eb9b329..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Worker;
-
-use Friendica\Core\Worker;
-use Friendica\Database\DBA;
-use Friendica\DI;
-use Friendica\Util\DateTimeFormat;
-
-/**
- * Delete all done workerqueue entries
- */
-class CleanWorkerQueue
-{
-       public static function execute()
-       {
-               DBA::delete('workerqueue', ["`done` AND `executed` < ?", DateTimeFormat::utc('now - 1 hour')]);
-
-               // Optimizing this table only last seconds
-               if (DI::config()->get('system', 'optimize_tables')) {
-                       // We are acquiring the two locks from the worker to avoid locking problems
-                       if (DI::lock()->acquire(Worker::LOCK_PROCESS, 10)) {
-                               if (DI::lock()->acquire(Worker::LOCK_WORKER, 10)) {
-                                       DBA::e("OPTIMIZE TABLE `workerqueue`");
-                                       DBA::e("OPTIMIZE TABLE `process`");                     
-                                       DI::lock()->release(Worker::LOCK_WORKER);
-                               }
-                               DI::lock()->release(Worker::LOCK_PROCESS);
-                       }
-               }
-       }
-}
index 0cf5e263232e9039193b58146ce29c27a28b50ef..01c54fed1845576124498faf43d02f712bb52eb9 100644 (file)
@@ -92,9 +92,6 @@ class Cron
                                Worker::add(PRIORITY_LOW, 'PullDirectory');
                        }
 
-                       // Delete all done workerqueue entries                  
-                       Worker::add(PRIORITY_LOW, 'CleanWorkerQueue');
-
                        // Clear cache entries
                        Worker::add(PRIORITY_LOW, 'ClearCache');
 
index df0d469fce2c32d099e6686ceabd00eab8b0dbc6..08634290b7dd854aae48b5d1e3f32db8cb1c9aa3 100644 (file)
@@ -1158,7 +1158,7 @@ return [
                ]
        ],
        "post-delivery" => [
-               "comment" => "Status of ActivityPub inboxes",
+               "comment" => "Delivery data for posts for the batch processing",
                "fields" => [
                        "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
                        "inbox-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of inbox url"],