Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate pg-boss for job scheduling #138

Open
rajdip-b opened this issue Feb 10, 2024 · 6 comments
Open

Integrate pg-boss for job scheduling #138

rajdip-b opened this issue Feb 10, 2024 · 6 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed scope: api Everything related to the API type: enhancement New feature or request
Milestone

Comments

@rajdip-b
Copy link
Member

Description

To run jobs in the background as cronjobs jobs, or jobs that might take up significant resources, we would like to use pg-boss. This would allow us to harness the power of our database.

This issue focuses on creating the client API for pg-boss

Use this article for reference: https://www.npmjs.com/package/pg-boss

Solution

  • Create a separate module and name it job-handler. Add a class called JobHandler in job.handler.ts.
  • It should have a constructor that will initialize pg boss.
  • It should have a generic function that will do the actual job on our behalf. The signature would be:
    async <T, V>registerJob(queue: string, callback: (job: V) => T) => T;
  • Export this module globally (take reference from how the prisma module is exported globally).
@rajdip-b rajdip-b added type: enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed scope: api Everything related to the API labels Feb 10, 2024
@rajdip-b rajdip-b added this to the Release v1 milestone Feb 10, 2024
@Ratnesh2003
Copy link
Contributor

/attempt

Copy link

Assigned the issue to you!

@rajdip-b
Copy link
Member Author

@Ratnesh2003 hey bro made any progress on this?

@rajdip-b
Copy link
Member Author

This issue is up for grabs again!

@rajdip-b
Copy link
Member Author

1 similar comment
@rajdip-b
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed scope: api Everything related to the API type: enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

2 participants