Skip to content

refactor: remove legacy cron-only deal and retrieval batch methods#363

Open
silent-cipher wants to merge 15 commits intomainfrom
refactor/cleanup-unused-methods
Open

refactor: remove legacy cron-only deal and retrieval batch methods#363
silent-cipher wants to merge 15 commits intomainfrom
refactor/cleanup-unused-methods

Conversation

@silent-cipher
Copy link
Collaborator

@silent-cipher silent-cipher commented Mar 17, 2026

Built on top of #355
Another setup towards #271

@FilOzzy FilOzzy added this to FOC Mar 17, 2026
@github-project-automation github-project-automation bot moved this to 📌 Triage in FOC Mar 17, 2026
@rjan90 rjan90 moved this from 📌 Triage to 🔎 Awaiting review in FOC Mar 17, 2026
@rjan90 rjan90 requested a review from SgtPooki March 17, 2026 08:42
@rjan90 rjan90 added this to the M4.2: mainnet GA milestone Mar 17, 2026
Copy link
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

Removes legacy “all providers / batch” methods that were only used by the old cron scheduler, continuing the cleanup/migration to pg-boss–managed per-provider orchestration.

Changes:

  • Removed cron-only batch retrieval orchestration helpers from RetrievalService.
  • Removed “create deals for all providers” flow from DealService and dev-tools API/service.
  • Deleted corresponding unit tests that targeted the removed cron-only behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
apps/backend/src/retrieval/retrieval.service.ts Removes batch retrieval selection + parallel processing helpers.
apps/backend/src/retrieval/retrieval.service.spec.ts Removes tests for the deleted parallel batch helper.
apps/backend/src/dev-tools/dev-tools.service.ts Removes dev-tools “all providers” deal creation trigger.
apps/backend/src/dev-tools/dev-tools.controller.ts Removes the /api/dev/deals/create-all endpoint.
apps/backend/src/deal/deal.service.ts Removes “create deals for all providers” orchestration + parallel helper.
apps/backend/src/deal/deal.service.spec.ts Removes tests for deleted orchestration and loosens dataset metadata assertion.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

private isPgBossMode(): boolean {
return (this.configService.get("jobs")?.mode ?? "cron") === "pgboss";
Copy link
Collaborator

Choose a reason for hiding this comment

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

@silent-cipher I think this one definitely needs addressed fully since we no longer have a "jobs.mode", this will always be false as it stands currently

Copy link
Collaborator Author

@silent-cipher silent-cipher Mar 17, 2026

Choose a reason for hiding this comment

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

This was supposed to be fixed in #355. I aligned isPgBossMode with the behavior of isPgbossEnabled from jobs.service.ts in 4453fac.

Base automatically changed from refactor/only-pgboss-scheduling to main March 17, 2026 15:47
Copy link
Collaborator

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

lgtm.. didn't see anything major

* starts pg-boss, registers workers, and starts the scheduler polling loop.
*/
async onModuleInit(): Promise<void> {
if (!this.isPgbossEnabled()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why rename?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

aah I rewrote this function after deleting it earlier, so the rename slipped in unintentionally in #355
Would you prefer I revert the naming change in this PR or handle it in a follow-up PR?

Comment on lines 807 to 808
const jobsConfig = this.configService.get("jobs", { infer: true });
const scheduling = this.configService.get("scheduling", { infer: true });
Copy link
Collaborator

Choose a reason for hiding this comment

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

what does infer: true do here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

infer set to true -> will automatically infer the property type based on config interface

@BigLep BigLep moved this from 🔎 Awaiting review to ✔️ Approved by reviewer in FOC Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✔️ Approved by reviewer

Development

Successfully merging this pull request may close these issues.

6 participants