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

Delay a job on startup #795

Merged
merged 5 commits into from
Nov 17, 2023

Conversation

IlyaSergeevich0
Copy link
Contributor

Closes #435

Used TimeSpanHelper to parse delay.

Feature works fine on standalone.

image
image

@IlyaSergeevich0 IlyaSergeevich0 marked this pull request as draft November 13, 2023 21:43
@IlyaSergeevich0
Copy link
Contributor Author

@Trojaner after second thought, should I implement same behavior for @single_exec and @reboot?

@Trojaner
Copy link
Member

Sounds like a good idea

@IlyaSergeevich0
Copy link
Contributor Author

Works fine on standalone

Jobs config:

jobs:
- name: OpenMod Auto Update
  args:
    commands:
    - openmod upgrade
  task: openmod_command
  schedule: 0 0 * * 0
  enabled: true
  
- name: Delay startup command
  args:
    commands:
    - test_startup_command
  task: openmod_command
  schedule: '@startup:5s'
  enabled: true

- name: Delay reboot command
  args:
    commands:
    - test_reboot_command
  task: openmod_command
  schedule: '@reboot:5s'
  enabled: true

- name: Delay single execution command
  args:
    commands:
    - test_single_exec_command
  task: openmod_command
  schedule: '@single_exec:5s'
  enabled: true

Log before om reload: openmod-2023-11-15-16-22-31.log

Log after om reload: openmod-2023-11-15-16-22-41.log

@IlyaSergeevich0 IlyaSergeevich0 marked this pull request as ready for review November 15, 2023 13:33
framework/OpenMod.Core/Jobs/JobScheduler.cs Dismissed Show dismissed Hide dismissed
@Trojaner
Copy link
Member

Thank you for your contribution.

@Trojaner Trojaner merged commit cee6857 into openmod:main Nov 17, 2023
11 checks passed
@Trojaner
Copy link
Member

Can you document this in the docs as well?

@IlyaSergeevich0
Copy link
Contributor Author

Sure, I'll create a new PR for this

@IlyaSergeevich0 IlyaSergeevich0 deleted the feature/startup-job-delay branch November 17, 2023 21:21
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 schedule that runs after some time after startup
2 participants