mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-13 19:47:45 +02:00
chore: update CI to v4.6.3 + all php and js dependencies
This commit is contained in:
parent
96b2df15b0
commit
346c00e7b5
206 changed files with 6239 additions and 5336 deletions
|
|
@ -25,13 +25,15 @@ class Generate extends BaseCommand
|
|||
{
|
||||
// get number of running clips to prevent from having too much running in parallel
|
||||
// TODO: get the number of running ffmpeg processes directly from the machine?
|
||||
$runningVideoClips = (new ClipModel())->getRunningVideoClipsCount();
|
||||
$runningVideoClips = new ClipModel()
|
||||
->getRunningVideoClipsCount();
|
||||
if ($runningVideoClips >= config('Admin')->videoClipWorkers) {
|
||||
return;
|
||||
}
|
||||
|
||||
// get all clips that haven't been processed yet
|
||||
$scheduledClips = (new ClipModel())->getScheduledVideoClips();
|
||||
$scheduledClips = new ClipModel()
|
||||
->getScheduledVideoClips();
|
||||
|
||||
if ($scheduledClips === []) {
|
||||
return;
|
||||
|
|
@ -45,13 +47,14 @@ class Generate extends BaseCommand
|
|||
];
|
||||
}
|
||||
|
||||
(new ClipModel())->updateBatch($data, 'id');
|
||||
new ClipModel()
|
||||
->updateBatch($data, 'id');
|
||||
|
||||
// Loop through clips to generate them
|
||||
foreach ($scheduledClips as $scheduledClip) {
|
||||
try {
|
||||
// set clip to pending
|
||||
(new ClipModel())
|
||||
new ClipModel()
|
||||
->update($scheduledClip->id, [
|
||||
'status' => 'running',
|
||||
'job_started_at' => Time::now(),
|
||||
|
|
@ -86,11 +89,12 @@ class Generate extends BaseCommand
|
|||
|
||||
$clipModel->clearVideoClipCache($scheduledClip->id);
|
||||
} catch (Exception $exception) {
|
||||
(new ClipModel())->update($scheduledClip->id, [
|
||||
'status' => 'failed',
|
||||
'logs' => $exception,
|
||||
'job_ended_at' => Time::now(),
|
||||
]);
|
||||
new ClipModel()
|
||||
->update($scheduledClip->id, [
|
||||
'status' => 'failed',
|
||||
'logs' => $exception,
|
||||
'job_ended_at' => Time::now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue