Commit 3ae62325 authored by Yassine Doghri's avatar Yassine Doghri
Browse files

fix(video-clips): clear video clip cache after process has finished

parent 8f999ce2
Pipeline #1210 passed with stages
in 8 minutes and 17 seconds
......@@ -53,10 +53,11 @@ class SchedulerController extends Controller
);
$exitCode = $clipper->generate();
$clipModel = new ClipModel();
if ($exitCode === 0) {
// success, video was generated
$scheduledClip->setMedia($clipper->videoClipFilePath);
(new ClipModel())->update($scheduledClip->id, [
$clipModel->update($scheduledClip->id, [
'media_id' => $scheduledClip->media_id,
'status' => 'passed',
'logs' => $clipper->logs,
......@@ -64,12 +65,13 @@ class SchedulerController extends Controller
]);
} else {
// error
(new ClipModel())->update($scheduledClip->id, [
$clipModel->update($scheduledClip->id, [
'status' => 'failed',
'logs' => $clipper->logs,
'job_ended_at' => Time::now(),
]);
}
$clipModel->clearVideoClipCache($scheduledClip->id);
}
return true;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment