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

[Job Launcher] Split cron jobs to launch and lock while running. #1383

Merged
merged 11 commits into from
Jan 7, 2024

Conversation

leric7
Copy link
Collaborator

@leric7 leric7 commented Dec 20, 2023

Description

We need to split the cron job to launch the escrow, to make every step more obvious - creation, setting up, and funding.
In addition, we'll handle all of those job entities with relevant status in each cron job run, and we want to lock cron job to prevent cron jobs running before previous one is finished.

Summary of changes

  • Split cron job to three separate ones.
  • Add cron job entity to database to lock each cron job run.
  • Updated test cases.

How test the changes

Related issues

Keywords for linking issues

Closes #1282, #1365.

Copy link

vercel bot commented Dec 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
job-launcher-server ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 5, 2024 9:09pm
8 Ignored Deployments
Name Status Preview Comments Updated (UTC)
escrow-dashboard ⬜️ Ignored (Inspect) Visit Preview Jan 5, 2024 9:09pm
faucet-server ⬜️ Ignored (Inspect) Visit Preview Jan 5, 2024 9:09pm
hufi-exchange-oracle-server ⬜️ Ignored (Inspect) Visit Preview Jan 5, 2024 9:09pm
hufi-job-launcher-server ⬜️ Ignored (Inspect) Visit Preview Jan 5, 2024 9:09pm
hufi-recording-oracle-server ⬜️ Ignored (Inspect) Visit Preview Jan 5, 2024 9:09pm
hufi-reputation-oracle ⬜️ Ignored (Inspect) Visit Preview Jan 5, 2024 9:09pm
job-launcher-client ⬜️ Ignored (Inspect) Visit Preview Jan 5, 2024 9:09pm
reputation-oracle-server ⬜️ Ignored (Inspect) Visit Preview Jan 5, 2024 9:09pm

@leric7 leric7 changed the base branch from main to develop December 20, 2023 12:51
@leric7 leric7 linked an issue Dec 20, 2023 that may be closed by this pull request
@leric7 leric7 self-assigned this Dec 21, 2023
Copy link
Collaborator

@portuu3 portuu3 left a comment

Choose a reason for hiding this comment

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

Also webhook cron job in webhook.service.ts should be included

@portuu3
Copy link
Collaborator

portuu3 commented Dec 22, 2023

I think these should be right statuses:

  PENDING = 'PENDING',
  PAID = 'PAID',
  CREATED = 'CREATED’,
  SET_UP = ‘SET_UP’,
  LAUNCHED = 'LAUNCHED',
  COMPLETED = 'COMPLETED',
  FAILED = 'FAILED',
  TO_CANCEL = 'TO_CANCEL',
  CANCELED = 'CANCELED',

So for each cron job:

  • Create: get PAID and set them to CREATED when the escrow has been created.
  • Set up: get CREATED and set them to SET_UP when the escrow has been set up.
  • Fund: get SET_UP and set them to LAUNCHED when the escrow has been funded and is ready to be processed.

@portuu3 portuu3 merged commit 6615c6e into develop Jan 7, 2024
@portuu3 portuu3 deleted the eric/job-launcher/split-cron-job branch January 7, 2024 10:39
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.

Job Launcher - Split launch jobs cron job Job Launcher - Cron job improvements
2 participants