Skip to content

feat: add backfill orchestration service#353

Open
Adeyemi-cmd wants to merge 1 commit into
StellaBridge:mainfrom
Adeyemi-cmd:feature/backfill-orchestration-service
Open

feat: add backfill orchestration service#353
Adeyemi-cmd wants to merge 1 commit into
StellaBridge:mainfrom
Adeyemi-cmd:feature/backfill-orchestration-service

Conversation

@Adeyemi-cmd
Copy link
Copy Markdown
Contributor

Close #297

PR Description

Summary

Add a dedicated backfill orchestration service for historical transaction ingestion with chunked execution, progress tracking, retry support, and resume capability.

What changed

  • Added BackfillService to manage job state, progress, and Redis-backed job metadata
  • Added BackfillQueue for BullMQ orchestration and job processing
  • Added backfill.job.ts to initialize the worker and handle chunk execution
  • Added REST endpoints under /api/v1/backfill:
    • POST / to start a backfill job
    • GET / to list active jobs
    • GET /:jobId to inspect a job
    • POST /:jobId/resume to resume a failed/paused job
  • Registered backfill routes in index.ts
  • Registered the backfill worker startup in index.ts
  • Added configuration defaults for backfill behavior to index.ts
  • Updated .env.example with backfill settings
  • Documented the new endpoint group in API.md
  • Added unit tests for backfill orchestration behavior

Testing

  • Verified backfill service behavior with unit tests:
    • npm exec --workspace=backend vitest run tests/services/backfill.service.test.ts
  • Result: 4 tests passed

Comment on lines +58 to +61
async () => {
const jobs = await backfillService.listBackfillJobs();
return { jobs };
},
}

private sleep(ms: number): Promise<void> {
return new Promise((resolve) => setTimeout(resolve, ms));
@Mosas2000
Copy link
Copy Markdown
Contributor

Resolve the conflict

@Mosas2000
Copy link
Copy Markdown
Contributor

Resolve conflict

@Mosas2000
Copy link
Copy Markdown
Contributor

Resolve the conflict

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Backfill Orchestration Service

3 participants