Skip to content

Commit

Permalink
Forgetting settings instance after each horizon job
Browse files Browse the repository at this point in the history
  • Loading branch information
Jnesselr committed Jan 28, 2024
1 parent 3e720aa commit 957ad60
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
use App\External\QuickBooks\QuickBooksAuthSettings;
use App\Http\Requests\SlackRequest;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Queue\Events\JobProcessed;
use Illuminate\Support\Facades\Queue;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\ServiceProvider;
use QuickBooksOnline\API\Core\OAuth\OAuth2\OAuth2LoginHelper;
Expand Down Expand Up @@ -46,5 +48,10 @@ public function boot(): void

return $dataService->getOAuth2LoginHelper();
});

Queue::after(function (JobProcessed $event) {
# This is bound via singleton instead of scoped, so we need to forget it to get updated settings each job
app()->forgetInstance('anlutro\LaravelSettings\SettingsManager');
});
}
}

0 comments on commit 957ad60

Please sign in to comment.