Skip to content

Commit c27f9b5

Browse files
authored
Merge pull request #2300 from codeeu/dev
Fix to handle the overload due to the multiple generation of the cert…
2 parents 5dd7caf + 11c7976 commit c27f9b5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

app/Console/Commands/CertificatesOfParticipationGeneration.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CertificatesOfParticipationGeneration extends Command
2828
public function handle(): int
2929
{
3030

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

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

app/Jobs/GenerateCertificatesOfParticipation.php

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public function handle(): void
3333
{
3434
$names = array_map('trim', explode(',', $this->participation->names));
3535

36+
$this->participation['status'] = 'PROCESSING';
37+
38+
$this->participation->save();
39+
3640
$zipUrl = CertificatesHelper::doGenerateCertificatesOfParticipation($names, $this->participation->event_name, $this->participation->event_date);
3741

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

0 commit comments

Comments
 (0)