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

RunOnceTrigger cannot be properly unmarshalled #118

Closed
anshul-raman opened this issue Mar 11, 2024 · 1 comment · Fixed by #120
Closed

RunOnceTrigger cannot be properly unmarshalled #118

anshul-raman opened this issue Mar 11, 2024 · 1 comment · Fixed by #120

Comments

@anshul-raman
Copy link

anshul-raman commented Mar 11, 2024

Expected Behaviour:
When using runOnceTrigger the job should fire after the given delay and expire immediately.

Current behaviour:
When using runOnceTrigger with the delay of 5secs, the job is never expired.

Steps to reproduce:
Use the following code to schedule the job in the jobQueue example given in the repository.

if err := scheduler.ScheduleJob(jobDetail1, quartz.NewRunOnceTrigger(5*time.Second)); err != nil {
	logger.Warnf("Failed to schedule job: %s", jobDetail1.JobKey())
}

Possible Cause:
The RunOnceTrigger has the expired field as private, because of which we cannot create expired RunOnceTriggers. When using persistent storage, the user needs to serialise and recreate the trigger. Allowing users to create expired RunOnceTrigger can solve the problem.

@reugn reugn changed the title RunOnceTrigger is not working RunOnceTrigger cannot be properly unmarshalled Mar 11, 2024
@reugn
Copy link
Owner

reugn commented Mar 11, 2024

@anshul-raman, PR #120 exports the expired field, to allow proper decoding of the trigger.

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 a pull request may close this issue.

2 participants