From 19fe7c36d0f093f38ef6faf773348b69db1da46f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 21 Apr 2023 13:03:00 +0200 Subject: [PATCH] Remove obsolete manual cronjob randomization. --- com.woltlab.wcf/package.xml | 1 - .../acp/install_com.woltlab.wcf_step2.php | 45 --------------- ...com.woltlab.wcf_6.0_randomize_cronjobs.php | 56 ------------------- 3 files changed, 102 deletions(-) delete mode 100644 wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_randomize_cronjobs.php diff --git a/com.woltlab.wcf/package.xml b/com.woltlab.wcf/package.xml index 1b8e0f2c48..4c467f3c0f 100644 --- a/com.woltlab.wcf/package.xml +++ b/com.woltlab.wcf/package.xml @@ -115,7 +115,6 @@ tar cvf com.woltlab.wcf/files_pre_check.tar -C wcfsetup/install/files/ \ acp/update_com.woltlab.wcf_6.0_favicon.php acp/update_com.woltlab.wcf_6.0_trophies.php acp/update_com.woltlab.wcf_6.0_removeDownloadedGravatars.php - acp/update_com.woltlab.wcf_6.0_randomize_cronjobs.php acp/update_com.woltlab.wcf_6.0_removeLegacyAppConfig.php diff --git a/wcfsetup/install/files/acp/install_com.woltlab.wcf_step2.php b/wcfsetup/install/files/acp/install_com.woltlab.wcf_step2.php index 1c89485717..0ddf46f2c7 100644 --- a/wcfsetup/install/files/acp/install_com.woltlab.wcf_step2.php +++ b/wcfsetup/install/files/acp/install_com.woltlab.wcf_step2.php @@ -75,51 +75,6 @@ CategoryEditor::create([ 'time' => TIME_NOW, ]); -// Randomize the times of the package list update and robot list update cronjobs. -$startMinute = \random_int(0, 59); -$startHour = \random_int(0, 23); - -$sql = "UPDATE wcf1_cronjob - SET startMinute = ?, - startHour = ?, - startDom = ?, - startMonth = ?, - startDow = ?, - lastExec = ?, - nextExec = ?, - afterNextExec = ? - WHERE packageID = ? - AND cronjobName = ?"; -$statement = WCF::getDB()->prepare($sql); -$statement->execute([ - $startMinute, - $startHour, - '*', - '*', - '*', - - 0, - \TIME_NOW, - 0, - - $this->installation->getPackageID(), - 'com.woltlab.wcf.refreshPackageUpdates', -]); -$statement->execute([ - $startMinute, - (($startHour + 12) % 24), - \random_int(1, 15), - '*', - '*', - - 0, - \TIME_NOW, - 0, - - $this->installation->getPackageID(), - 'com.woltlab.wcf.refreshSearchRobots', -]); - // Configure dynamic option values $sql = "UPDATE wcf1_option SET optionValue = ? diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_randomize_cronjobs.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_randomize_cronjobs.php deleted file mode 100644 index deb10a6e7e..0000000000 --- a/wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_randomize_cronjobs.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @package WoltLabSuite\Core - */ - -use wcf\system\WCF; - -$startMinute = \random_int(0, 59); -$startHour = \random_int(0, 23); - -$sql = "UPDATE wcf1_cronjob - SET startMinute = ?, - startHour = ?, - startDom = ?, - startMonth = ?, - startDow = ?, - lastExec = ?, - nextExec = ?, - afterNextExec = ? - WHERE packageiD = ? - AND cronjobName = ?"; -$statement = WCF::getDB()->prepare($sql); -$statement->execute([ - $startMinute, - $startHour, - '*', - '*', - '*', - - 0, - \TIME_NOW, - 0, - - $this->installation->getPackageID(), - 'com.woltlab.wcf.refreshPackageUpdates', -]); -$statement->execute([ - $startMinute, - (($startHour + 12) % 24), - \random_int(1, 15), - '*', - '*', - - 0, - \TIME_NOW, - 0, - - $this->installation->getPackageID(), - 'com.woltlab.wcf.refreshSearchRobots', -]); -- 2.20.1