Skip to content

Commit 2da17b7

Browse files
committed
simple stagger updates
1 parent 1e3ac5f commit 2da17b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hooks/pluginable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ public function update_core() {
538538
* Update plugins from their given git repo.
539539
*/
540540
function update_plugins() {
541+
sleep(mt_rand(1, 30)); // stagger actual update check
541542
$this->log( 'Running update plugins...' );
542543
$pluginsDir = '/usr/local/hestia/plugins';
543544
$subfolders = glob( $pluginsDir . '/*', GLOB_ONLYDIR );
@@ -572,7 +573,6 @@ function update_plugins() {
572573

573574
// Do a force reset on the repo to avoid merge conflicts, and obtain found latest version
574575
$cmd = 'cd ' . $subfolder . ' && git reset --hard';
575-
$cmd .= ' && sleep ' . mt_rand(1, 60); // Random sleep to avoid git rate limiting
576576
$cmd .= ' && git clean -f -d';
577577
$cmd .= ' && git fetch --all';
578578
$cmd .= ' && git clone --depth 1 --branch "' . $latest_version . '" ' . $url . ' 2>/dev/null';

0 commit comments

Comments
 (0)