Skip to content

Commit

Permalink
simple stagger updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveorevo committed Sep 18, 2023
1 parent 1e3ac5f commit 2da17b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hooks/pluginable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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';
Expand Down

0 comments on commit 2da17b7

Please sign in to comment.