From b68a16e07acbba6efc9a1941ab740d045ab8c54d Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 22 Mar 2020 13:12:48 +0000 Subject: [PATCH] "repair diaspora" fixed some problem long time ago. It is not needed anymore --- src/Worker/Cron.php | 3 --- src/Worker/CronJobs.php | 44 ----------------------------------------- 2 files changed, 47 deletions(-) diff --git a/src/Worker/Cron.php b/src/Worker/Cron.php index 714f840595..a47193334c 100644 --- a/src/Worker/Cron.php +++ b/src/Worker/Cron.php @@ -69,9 +69,6 @@ class Cron // Clear cache entries Worker::add(PRIORITY_LOW, "CronJobs", "clear_cache"); - // Repair missing Diaspora values in contacts - Worker::add(PRIORITY_LOW, "CronJobs", "repair_diaspora"); - // Repair entries in the database Worker::add(PRIORITY_LOW, "CronJobs", "repair_database"); diff --git a/src/Worker/CronJobs.php b/src/Worker/CronJobs.php index b66358b0e8..2a6c97e842 100644 --- a/src/Worker/CronJobs.php +++ b/src/Worker/CronJobs.php @@ -84,10 +84,6 @@ class CronJobs self::clearCache($a); break; - case 'repair_diaspora': - self::repairDiaspora($a); - break; - case 'repair_database': self::repairDatabase(); break; @@ -244,46 +240,6 @@ class CronJobs DI::config()->set('system', 'cache_last_cleared', time()); } - /** - * Repair missing values in Diaspora contacts - * - * @param App $a - * @throws \Friendica\Network\HTTPException\InternalServerErrorException - * @throws \ImagickException - */ - private static function repairDiaspora(App $a) - { - $starttime = time(); - - $r = q("SELECT `id`, `url` FROM `contact` - WHERE `network` = '%s' AND (`batch` = '' OR `notify` = '' OR `poll` = '' OR pubkey = '') - ORDER BY RAND() LIMIT 50", DBA::escape(Protocol::DIASPORA)); - if (!DBA::isResult($r)) { - return; - } - - foreach ($r as $contact) { - // Quit the loop after 3 minutes - if (time() > ($starttime + 180)) { - return; - } - - if (!GServer::reachable($contact["url"])) { - continue; - } - - $data = Probe::uri($contact["url"]); - if ($data["network"] != Protocol::DIASPORA) { - continue; - } - - Logger::log("Repair contact " . $contact["id"] . " " . $contact["url"], Logger::DEBUG); - q("UPDATE `contact` SET `batch` = '%s', `notify` = '%s', `poll` = '%s', pubkey = '%s' WHERE `id` = %d", - DBA::escape($data["batch"]), DBA::escape($data["notify"]), DBA::escape($data["poll"]), DBA::escape($data["pubkey"]), - intval($contact["id"])); - } - } - /** * Do some repairs in database entries *