Skip to content
Snippets Groups Projects
Commit 25773229 authored by Dillenn Terumalai's avatar Dillenn Terumalai :speech_balloon:
Browse files

fix: Fixed callbacks being triggered twice

parent 7e87ca51
Branches
Tags v1.1.1
No related merge requests found
Pipeline #2362 passed
......@@ -96,16 +96,12 @@ class SlurmConnector implements ClusterInterface
$collection->each(function ($job) {
$clusterJob = JobModel::findOrFail($job['id']);
event(new JobQueued($clusterJob, $job['queued_at']));
$jobClass = $clusterJob->job;
if ($job['event'] === 'completed_at') {
event(new JobCompleted($clusterJob, $job['datetime']));
$jobClass->onSuccess($clusterJob);
} elseif ($job['event'] === 'failed_at') {
event(new JobFailed($clusterJob, $job['datetime']));
$jobClass->onFailure($clusterJob);
} elseif ($job['event'] === 'cancelled_at') {
event(new JobCancelled($clusterJob, $job['datetime']));
$jobClass->onCancel($clusterJob);
}
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment