Skip to content

Commit

Permalink
Merge pull request #94 from cego/niza/use-lazy-loading-for-unstuc-pro…
Browse files Browse the repository at this point in the history
…cessing

Made use of DB cursor instead of fetching everything
  • Loading branch information
nizacegodk authored Nov 15, 2023
2 parents c05e991 + f330884 commit d826d0f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected function unstuckProcessingRequestInsurances(): void
{
RequestInsurance::query()->where('state', State::PROCESSING)
->where('state_changed_at', '<', Carbon::now('UTC')->subMinutes(10))
->get()
->cursor()
->each(function (RequestInsurance $requestInsurance) {
// State is updated based on retry_inconsistent
$stateChange = $requestInsurance->retry_inconsistent ? State::READY : State::FAILED;
Expand Down

0 comments on commit d826d0f

Please sign in to comment.