diff --git a/app/Listeners/GitLab/Project/DisableForking.php b/app/Listeners/GitLab/Project/DisableForking.php index c7bde004..f7952a36 100644 --- a/app/Listeners/GitLab/Project/DisableForking.php +++ b/app/Listeners/GitLab/Project/DisableForking.php @@ -43,16 +43,15 @@ public function handle(ProjectCreated $event): void Log::info("Disabling GitLab forking for project {$event->project->id}"); - $attempts = 3; + $attempts = 7; $gitLabManager = app(GitLabManager::class); $project = $gitLabManager->projects()->show($event->project->gitlab_project_id); while (($project['import_error'] != null || $project['import_status'] != 'finished') && $attempts > 1) { // The system is sometimes too fast for the Gitlab server, this buys the Gitlab server some more time before Scalable moves on. - usleep(250000); + usleep(300_000); $attempts--; $project = $gitLabManager->projects()->show($event->project->gitlab_project_id); - } if($project['import_error'] != null || $project['import_status'] != 'finished') diff --git a/app/Listeners/GitLab/Project/UnprotectDefaultBranch.php b/app/Listeners/GitLab/Project/UnprotectDefaultBranch.php index 26d8f9ee..c198cc70 100644 --- a/app/Listeners/GitLab/Project/UnprotectDefaultBranch.php +++ b/app/Listeners/GitLab/Project/UnprotectDefaultBranch.php @@ -44,14 +44,14 @@ public function handle(ProjectCreated $event): void $gitLabManager = app(GitLabManager::class); - $attempts = 3; + $attempts = 7; $project = $gitLabManager->projects()->show($event->project->gitlab_project_id); while (($project['import_error'] != null || $project['import_status'] != 'finished') && $attempts > 1) { // The system is sometimes too fast for the Gitlab server, this buys the Gitlab server some more time before Scalable moves on. - usleep(250000); + usleep(300_000); $attempts--; $project = $gitLabManager->projects()->show($event->project->gitlab_project_id); diff --git a/tests/Unit/App/Jobs/DisableForkingJobTest.php b/tests/Unit/App/Jobs/DisableForkingJobTest.php index de7691cf..df85d36e 100644 --- a/tests/Unit/App/Jobs/DisableForkingJobTest.php +++ b/tests/Unit/App/Jobs/DisableForkingJobTest.php @@ -52,7 +52,7 @@ $this->project->save(); $this->mock(GitLabManager::class, function (MockInterface $mock) { - $mock->shouldReceive('projects->show')->atMost()->times(3)->andReturn([ + $mock->shouldReceive('projects->show')->atMost()->times(7)->andReturn([ 'import_error' => 'error', 'import_status' => 'finished', ]); diff --git a/tests/Unit/App/Jobs/UnprotectDefaultBranchJobTest.php b/tests/Unit/App/Jobs/UnprotectDefaultBranchJobTest.php index 17a6ee3f..4ab33dd8 100644 --- a/tests/Unit/App/Jobs/UnprotectDefaultBranchJobTest.php +++ b/tests/Unit/App/Jobs/UnprotectDefaultBranchJobTest.php @@ -52,7 +52,7 @@ $this->project->save(); $this->mock(GitLabManager::class, function (MockInterface $mock) { - $mock->shouldReceive('projects->show')->atMost()->times(3)->andReturn([ + $mock->shouldReceive('projects->show')->atMost()->times(7)->andReturn([ 'import_error' => 'error', 'import_status' => 'finished', ]);