]> git.mxchange.org Git - friendica.git/commitdiff
Renamed classes
authorMichael <heluecht@pirati.ca>
Tue, 1 Sep 2020 13:40:37 +0000 (13:40 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 1 Sep 2020 13:40:37 +0000 (13:40 +0000)
src/Worker/CheckDeletedContacts.php [new file with mode: 0644]
src/Worker/CheckdeletedContacts.php [deleted file]
src/Worker/CleanWorkerqueue.php [new file with mode: 0644]
src/Worker/ClearWorkerqueue.php [deleted file]
src/Worker/Cron.php

diff --git a/src/Worker/CheckDeletedContacts.php b/src/Worker/CheckDeletedContacts.php
new file mode 100644 (file)
index 0000000..e1aa57f
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/**
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @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;
+
+/**
+ * Checks for contacts that are about to be deleted and ensures that they are removed.
+ * This should be done automatically in the "remove" function. This here is a cleanup job.
+ */
+class CheckDeletedContacts
+{
+       public static function execute()
+       {
+               $contacts = DBA::select('contact', ['id'], ['deleted' => true]);
+               while ($contact = DBA::fetch($contacts)) {
+                       Worker::add(PRIORITY_MEDIUM, 'RemoveContact', $contact['id']);
+               }
+               DBA::close($contacts);
+       }
+}
diff --git a/src/Worker/CheckdeletedContacts.php b/src/Worker/CheckdeletedContacts.php
deleted file mode 100644 (file)
index c474952..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2020, Friendica
- *
- * @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;
-
-/**
- * Checks for contacts that are about to be deleted and ensures that they are removed.
- * This should be done automatically in the "remove" function. This here is a cleanup job.
- */
-class CheckdeletedContacts
-{
-       public static function execute()
-       {
-               $contacts = DBA::select('contact', ['id'], ['deleted' => true]);
-               while ($contact = DBA::fetch($contacts)) {
-                       Worker::add(PRIORITY_MEDIUM, 'RemoveContact', $contact['id']);
-               }
-               DBA::close($contacts);
-       }
-}
diff --git a/src/Worker/CleanWorkerqueue.php b/src/Worker/CleanWorkerqueue.php
new file mode 100644 (file)
index 0000000..00559f7
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @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;
+
+/**
+ * Delete all done workerqueue entries
+ */
+class CleanWorkerQueue
+{
+       public static function execute()
+       {
+               DBA::delete('workerqueue', ['`done` AND `executed` < UTC_TIMESTAMP() - INTERVAL 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);
+                       }
+               }
+       }
+}
diff --git a/src/Worker/ClearWorkerqueue.php b/src/Worker/ClearWorkerqueue.php
deleted file mode 100644 (file)
index c46eba6..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2020, Friendica
- *
- * @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;
-
-/**
- * Delete all done workerqueue entries
- */
-class ClearWorkerqueue
-{
-       public static function execute()
-       {
-               DBA::delete('workerqueue', ['`done` AND `executed` < UTC_TIMESTAMP() - INTERVAL 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 2a2e5e57a902d0d35a8aae199c91a8bf6076fa7a..7a23a2c705db6aee111bc8b76d10472a989976d1 100644 (file)
@@ -83,7 +83,7 @@ class Cron
                        }
 
                        // Delete all done workerqueue entries                  
-                       Worker::add(PRIORITY_LOW, 'ClearWorkerqueue');
+                       Worker::add(PRIORITY_LOW, 'CleanWorkerQueue');
 
                        // Clear cache entries
                        Worker::add(PRIORITY_LOW, 'ClearCache');
@@ -114,7 +114,7 @@ class Cron
                        // check upstream version?
                        Worker::add(PRIORITY_LOW, 'CheckVersion');
 
-                       Worker::add(PRIORITY_LOW, 'CheckdeletedContacts');
+                       Worker::add(PRIORITY_LOW, 'CheckDeletedContacts');
 
                        if (DI::config()->get('system', 'optimize_tables')) {
                                Worker::add(PRIORITY_LOW, 'OptimizeTables');