Refactor DockerCleanupJob and Application model

This commit is contained in:
Andras Bacsai committed 2023-11-10 10:34:28 +01:00
1 parent ed34fc9645
commit 23a94c9378
2 files changed
+23 -13

No files matched your search

+8
View File
@@ -213,6 +213,14 @@ class Application extends BaseModel
return $this->morphTo();
}
public function isDeploymentInprogress() {
$deployments = ApplicationDeploymentQueue::where('application_id', $this->id)->where('status', 'in_progress')->count();
if ($deployments > 0) {
return true;
}
return false;
}
public function deployments(int $skip = 0, int $take = 10)
{
$deployments = ApplicationDeploymentQueue::where('application_id', $this->id)->orderBy('created_at', 'desc');