diff --git a/app/Mail/Drip/FeedbackEmail.php b/app/Mail/Drip/FeedbackEmail.php index b2029c40..02180c7b 100644 --- a/app/Mail/Drip/FeedbackEmail.php +++ b/app/Mail/Drip/FeedbackEmail.php @@ -15,6 +15,20 @@ class FeedbackEmail extends Mailable implements ShouldQueue { use Queueable, SerializesModels; + /** + * The number of times the job may be attempted. + * + * @var int + */ + public $tries = 5; + + /** + * The number of seconds to wait before retrying the job. + * + * @var array + */ + public $backoff = [2, 5, 10, 30]; + public function __construct(public User $user) { $this->onQueue('emails'); diff --git a/app/Mail/Drip/ImportHelpEmail.php b/app/Mail/Drip/ImportHelpEmail.php index 7293a74e..fa3fe7b2 100644 --- a/app/Mail/Drip/ImportHelpEmail.php +++ b/app/Mail/Drip/ImportHelpEmail.php @@ -15,6 +15,20 @@ class ImportHelpEmail extends Mailable implements ShouldQueue { use Queueable, SerializesModels; + /** + * The number of times the job may be attempted. + * + * @var int + */ + public $tries = 5; + + /** + * The number of seconds to wait before retrying the job. + * + * @var array + */ + public $backoff = [2, 5, 10, 30]; + public function __construct(public User $user) { $this->onQueue('emails'); diff --git a/app/Mail/Drip/OnboardingReminderEmail.php b/app/Mail/Drip/OnboardingReminderEmail.php index c0555405..82765651 100644 --- a/app/Mail/Drip/OnboardingReminderEmail.php +++ b/app/Mail/Drip/OnboardingReminderEmail.php @@ -15,6 +15,20 @@ class OnboardingReminderEmail extends Mailable implements ShouldQueue { use Queueable, SerializesModels; + /** + * The number of times the job may be attempted. + * + * @var int + */ + public $tries = 5; + + /** + * The number of seconds to wait before retrying the job. + * + * @var array + */ + public $backoff = [2, 5, 10, 30]; + public function __construct(public User $user) { $this->onQueue('emails'); diff --git a/app/Mail/Drip/PromoCodeEmail.php b/app/Mail/Drip/PromoCodeEmail.php index 8f2c4326..d7b4cc7e 100644 --- a/app/Mail/Drip/PromoCodeEmail.php +++ b/app/Mail/Drip/PromoCodeEmail.php @@ -15,6 +15,20 @@ class PromoCodeEmail extends Mailable implements ShouldQueue { use Queueable, SerializesModels; + /** + * The number of times the job may be attempted. + * + * @var int + */ + public $tries = 5; + + /** + * The number of seconds to wait before retrying the job. + * + * @var array + */ + public $backoff = [2, 5, 10, 30]; + public function __construct(public User $user) { $this->onQueue('emails'); diff --git a/app/Mail/Drip/WelcomeEmail.php b/app/Mail/Drip/WelcomeEmail.php index d49d831f..c4dee602 100644 --- a/app/Mail/Drip/WelcomeEmail.php +++ b/app/Mail/Drip/WelcomeEmail.php @@ -15,6 +15,20 @@ class WelcomeEmail extends Mailable implements ShouldQueue { use Queueable, SerializesModels; + /** + * The number of times the job may be attempted. + * + * @var int + */ + public $tries = 5; + + /** + * The number of seconds to wait before retrying the job. + * + * @var array + */ + public $backoff = [2, 5, 10, 30]; + public function __construct(public User $user) { $this->onQueue('emails'); diff --git a/app/Mail/UserLeadInvitation.php b/app/Mail/UserLeadInvitation.php index f073c998..682d076e 100644 --- a/app/Mail/UserLeadInvitation.php +++ b/app/Mail/UserLeadInvitation.php @@ -15,6 +15,20 @@ class UserLeadInvitation extends Mailable implements ShouldQueue { use Queueable, SerializesModels; + /** + * The number of times the job may be attempted. + * + * @var int + */ + public $tries = 5; + + /** + * The number of seconds to wait before retrying the job. + * + * @var array + */ + public $backoff = [2, 5, 10, 30]; + /** * Create a new message instance. */ diff --git a/docker/supervisor/supervisord.conf b/docker/supervisor/supervisord.conf index 0c4874be..b712c902 100644 --- a/docker/supervisor/supervisord.conf +++ b/docker/supervisor/supervisord.conf @@ -54,9 +54,19 @@ autorestart=true stderr_logfile=/var/log/worker-inertia-ssr.log stdout_logfile=/var/log/worker-inertia-ssr.log +[program:queue-worker-emails] +process_name=%(program_name)s +command=php /app/artisan queue:work database --queue=emails --sleep=1 --tries=5 --max-time=3600 +autostart=true +autorestart=true +redirect_stderr=true +stdout_logfile=/var/log/queue-worker-emails.log +stopwaitsecs=3600 +numprocs=1 + [program:queue-worker] process_name=%(program_name)s_%(process_num)02d -command=php /app/artisan queue:work database --queue=emails,default --sleep=3 --tries=3 --max-time=3600 +command=php /app/artisan queue:work database --queue=default --sleep=3 --tries=3 --max-time=3600 autostart=true autorestart=true redirect_stderr=true