File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 66use App \Models \Site ;
77use Illuminate \Console \Command ;
88use App \Console \Traits \RequestTargetVersion ;
9+ use Illuminate \Support \Facades \Log ;
910
1011class PerformUpdate extends Command
1112{
@@ -35,6 +36,14 @@ public function handle(): int
3536 /** @var Site $site */
3637 $ site = Site::findOrFail ($ this ->input ->getArgument ('siteId ' ));
3738
39+ $ updateCount = $ site ->updates ()->where ('new_version ' , $ targetVersion )->count ();
40+
41+ if ($ updateCount >= config ('autoupdates.max_update_tries ' )) {
42+ Log::info ("Update Loop detected for Site: " . $ site ->id . '; TargetVersion: ' . $ targetVersion );
43+
44+ return Command::SUCCESS ;
45+ }
46+
3847 UpdateSite::dispatchSync (
3948 $ site ,
4049 $ targetVersion
Original file line number Diff line number Diff line change 44 'healthcheck_interval ' => env ('HEALTH_CHECK_INTERVAL ' , 24 ),
55 'cleanup_site_delay ' => env ('CLEANUP_SITE_DELAY ' , 7 ),
66 'tuf_repo_cachetime ' => env ('TUF_REPO_CACHETIME ' , 5 ),
7+ 'max_update_tries ' => env ('MAX_UPDATE_TRIES ' , 5 ),
78];
You can’t perform that action at this time.
0 commit comments