Skip to content

fix: providers table is updated every 4 hours#268

Merged
SgtPooki merged 5 commits intomainfrom
fix/add-daily-job-for-updating-providers
Feb 18, 2026
Merged

fix: providers table is updated every 4 hours#268
SgtPooki merged 5 commits intomainfrom
fix/add-daily-job-for-updating-providers

Conversation

@SgtPooki
Copy link
Copy Markdown
Collaborator

add daily job to update providers.

previously, providers were only updated on startup or restart.

fixes #260

Copilot AI review requested due to automatic review settings February 11, 2026 22:16
@FilOzzy FilOzzy added this to FOC Feb 11, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Feb 11, 2026
@SgtPooki SgtPooki moved this from 📌 Triage to 🔎 Awaiting review in FOC Feb 11, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 JobScheduleType to JobType for consistency and added providers_refresh job 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.

Comment thread apps/backend/src/jobs/jobs.service.ts
@BigLep
Copy link
Copy Markdown
Contributor

BigLep commented Feb 13, 2026

2026-02-13 verbal: les switch to every few hours

@SgtPooki SgtPooki changed the title fix: providers table is updated daily fix: providers table is updated every 4 hours Feb 13, 2026
Comment thread apps/backend/src/jobs/jobs.service.ts Outdated
Comment thread apps/backend/src/jobs/jobs.service.ts
Comment thread apps/backend/src/scheduler/scheduler.service.ts Outdated
@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting review to ✔️ Approved by reviewer in FOC Feb 17, 2026
@SgtPooki SgtPooki merged commit e5debd9 into main Feb 18, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC Feb 18, 2026
@SgtPooki SgtPooki deleted the fix/add-daily-job-for-updating-providers branch February 18, 2026 07:33
Copy link
Copy Markdown
Collaborator

@silent-cipher silent-cipher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

pgboss/jobs mode should refresh providers daily

5 participants