Skip to content

Refactoring Potential. #631

@herpaderpaldent

Description

@herpaderpaldent

private function dispatchFollowUpJobs()
{
$this->dispatchMissingTypeJobs();
$this->dispatchMissingLocationJobs();
}
private function dispatchMissingTypeJobs()
{
WalletTransaction::query()
->doesntHave('type')
->pluck('type_id')
->unique()
->each(fn ($type_id) => ResolveUniverseTypeByIdJob::dispatch($type_id)->onQueue('high'));
}
private function dispatchMissingLocationJobs()
{
$refresh_token = $this->getRefreshToken();
WalletTransaction::query()
->doesntHave('location')
->pluck('location_id')
->unique()
->each(fn ($location_id) => ResolveLocationJob::dispatch($location_id, $refresh_token)->onQueue('high'));
}

Ideas:

  • One could leverage the maintenance job to handle the follow up jobs
  • add the follow up jobs to the batch if batching

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions