From 2da17b7d53afe664690307e266d3aa5ab4e246aa Mon Sep 17 00:00:00 2001 From: Stephen J Carnam Date: Mon, 18 Sep 2023 15:47:29 -0700 Subject: [PATCH] simple stagger updates --- hooks/pluginable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/pluginable.php b/hooks/pluginable.php index d991461..c21a4e6 100644 --- a/hooks/pluginable.php +++ b/hooks/pluginable.php @@ -538,6 +538,7 @@ public function update_core() { * Update plugins from their given git repo. */ function update_plugins() { + sleep(mt_rand(1, 30)); // stagger actual update check $this->log( 'Running update plugins...' ); $pluginsDir = '/usr/local/hestia/plugins'; $subfolders = glob( $pluginsDir . '/*', GLOB_ONLYDIR ); @@ -572,7 +573,6 @@ function update_plugins() { // Do a force reset on the repo to avoid merge conflicts, and obtain found latest version $cmd = 'cd ' . $subfolder . ' && git reset --hard'; - $cmd .= ' && sleep ' . mt_rand(1, 60); // Random sleep to avoid git rate limiting $cmd .= ' && git clean -f -d'; $cmd .= ' && git fetch --all'; $cmd .= ' && git clone --depth 1 --branch "' . $latest_version . '" ' . $url . ' 2>/dev/null';