Handling Setting Changes along with queued actions #58
Unanswered
ragingdave
asked this question in
Q&A
Replies: 2 comments
-
@ragingdave Maybe it's a little late for an answer. But I was experiencing an issue with this also. I fixed it today by adding a function to the queue which runs before each job. Queue::before(function () {
app(SiteSettings::class)->refresh();
$this->bootMailSettings();
}); I added this to the boot method of my service provider. It refreshes the settings and sets up some mailer configuration in my case. Hope this helps! |
Beta Was this translation helpful? Give feedback.
0 replies
-
2024 and hit this problem also. Thanks for the tip @SebastiaanKloos |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I came across an oddity/edge case (maybe?) around using settings in queue jobs/mails/etc. Changing a setting doesn't update the queue workers as those are long lived and in tandem with the caching, makes it so that the value from settings doesn't change until at least horizon restarts itself.
One solution I thought of was to trigger a call (only queued based on laravel/framework#28217) to
horizon:terminate
in the SettingsSaved event, which would theoretically short term fix the issue, but I feel like that's just a band aid, more than a fix.What are the thoughts on how best to approach the issue?
Beta Was this translation helpful? Give feedback.
All reactions