Skip to content

Commit

Permalink
Fix to handle the overload due to the multiple generation of the cert…
Browse files Browse the repository at this point in the history
…ificates of participation
  • Loading branch information
alainvd committed Oct 16, 2024
1 parent 2c97f97 commit 11c7976
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CertificatesOfParticipationGeneration extends Command
public function handle(): int
{

$participations = Participation::whereNull('participation_url')->where('status', '<>', 'ERROR')->orderByDesc('created_at')->get();
$participations = Participation::whereNull('participation_url')->where('status', '=', 'PENDING')->orderByDesc('created_at')->get();

$this->info(count($participations).' certificates of participation to generate');

Expand Down
4 changes: 4 additions & 0 deletions app/Jobs/GenerateCertificatesOfParticipation.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public function handle(): void
{
$names = array_map('trim', explode(',', $this->participation->names));

$this->participation['status'] = 'PROCESSING';

$this->participation->save();

$zipUrl = CertificatesHelper::doGenerateCertificatesOfParticipation($names, $this->participation->event_name, $this->participation->event_date);

$this->participation['participation_url'] = $zipUrl;
Expand Down

0 comments on commit 11c7976

Please sign in to comment.