keyshade icon indicating copy to clipboard operation
keyshade copied to clipboard

feat: Integrate pg-boss for job scheduling

Open Allan2000-Git opened this issue 4 months ago • 4 comments

User description

Description

This PR adds a integrates pg-boss for job scheduling. This allows us to run jobs in the background as cron jobs or jobs that might take up significant resources.

Fixes #138

Dependencies

Installed packages: pg-boss

Future Improvements

N/A

Mentions

@rajdip-b

Screenshots of relevant screens

N/A

Developer's checklist

  • [x] My PR follows the style guidelines of this project
  • [x] I have performed a self-check on my work

If changes are made in the code:

  • [x] I have followed the coding guidelines
  • [x] My changes in code generate no new warnings
  • [ ] My changes are breaking another fix/feature of the project
  • [ ] I have added test cases to show that my feature works
  • [ ] I have added relevant screenshots in my PR
  • [x] There are no UI/UX issues

Documentation Update

  • [ ] This PR requires an update to the documentation at docs.keyshade.xyz
  • [ ] I have made the necessary updates to the documentation, or no documentation changes are required.

PR Type

Enhancement


Description

  • Integrated pg-boss for job scheduling by adding a new JobHandler class.
  • Updated CommonModule to include JobHandler in providers and exports.
  • Added pg-boss to the project dependencies in package.json.
  • Updated pnpm-lock.yaml to reflect the new dependencies.

Changes walkthrough 📝

Relevant files
Enhancement
common.module.ts
Add JobHandler to CommonModule providers and exports         

apps/api/src/common/common.module.ts

  • Added JobHandler to the providers and exports arrays.
+3/-2     
job.handler.ts
Implement JobHandler class for job scheduling                       

apps/api/src/common/job.handler.ts

  • Created JobHandler class for managing jobs with pg-boss.
  • Implemented methods to initialize, register, schedule, and stop jobs.
  • Added error handling and logging for job operations.
  • +68/-0   
    Dependencies
    package.json
    Add pg-boss dependency for job scheduling                               

    apps/api/package.json

  • Added pg-boss as a new dependency.
  • Adjusted the order of reflect-metadata in devDependencies.
  • +2/-1     
    pnpm-lock.yaml
    Update pnpm-lock.yaml with pg-boss dependencies                   

    pnpm-lock.yaml

    • Updated lock file to include pg-boss and its dependencies.
    +269/-10

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Allan2000-Git avatar Oct 05 '24 07:10 Allan2000-Git