refactor: enhance ApplicationDeploymentJob and HorizonServiceProvider for improved job handling
- Removed the private property for application deployment queue ID in ApplicationDeploymentJob and utilized constructor property promotion. - Added a tags method in ApplicationDeploymentJob to properly identify the worker running the job. - Updated HorizonServiceProvider to handle cases where the deployment queue ID is blank, preventing potential errors during job processing. - Cleaned up the isAnyDeploymentInprogress function by removing unnecessary whitespace.
This commit is contained in:
@@ -38,6 +38,9 @@ class HorizonServiceProvider extends HorizonApplicationServiceProvider
|
||||
$deploymentQueueId = collect($tags)->first(function ($tag) {
|
||||
return str_contains($tag, 'App\Models\ApplicationDeploymentQueue');
|
||||
});
|
||||
if (blank($deploymentQueueId)) {
|
||||
return;
|
||||
}
|
||||
$deploymentQueueId = explode(':', $deploymentQueueId)[1];
|
||||
$deploymentQueue = ApplicationDeploymentQueue::find($deploymentQueueId);
|
||||
$deploymentQueue->update([
|
||||
|
||||
Reference in New Issue
Block a user