Skip to content

Commit

Permalink
Merge pull request #2300 from codeeu/dev
Browse files Browse the repository at this point in the history
Fix to handle the overload due to the multiple generation of the cert…
  • Loading branch information
alainvd authored Oct 16, 2024
2 parents 5dd7caf + 11c7976 commit c27f9b5
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 c27f9b5

Please sign in to comment.