fix: providers table is updated every 4 hours#268
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a daily scheduled job to refresh provider data from the blockchain, addressing an issue where providers were only updated on application startup or restart. The implementation supports both the legacy cron scheduler and the pg-boss job scheduler modes.
Changes:
- Added daily provider refresh job that runs at midnight UTC in both scheduler modes
- Fixed missing cache clearing for active and approved provider address sets during refresh
- Renamed
JobScheduleTypetoJobTypefor consistency and addedproviders_refreshjob type
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/backend/src/wallet-sdk/wallet-sdk.service.ts | Fixed loadProviders to properly clear activeProviderAddresses and approvedProviderAddresses sets before repopulating |
| apps/backend/src/scheduler/scheduler.service.ts | Added @Cron decorator for daily provider refresh at midnight with appropriate guards for pgboss mode and disabled features |
| apps/backend/src/jobs/jobs.service.ts | Added providers_refresh job type, worker registration, handler implementation, schedule row creation, and all necessary job name mappings |
| apps/backend/src/database/entities/job-schedule-state.entity.ts | Renamed JobScheduleType to JobType and added providers_refresh to the union type |
| apps/backend/src/jobs/repositories/job-schedule.repository.ts | Updated type references from JobScheduleType to JobType for consistency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
2026-02-13 verbal: les switch to every few hours |
silent-cipher
left a comment
There was a problem hiding this comment.
@SgtPooki Noticed this when adding data retention job - there are two functions in the job repository (countBossJobStates and minBossJobAgeSecondsByState) that should also include the providers_refresh job type. Happy to follow up with small pr if needed.
add daily job to update providers.
previously, providers were only updated on startup or restart.
fixes #260