How can I run a Job just once #1448
Unanswered
Richard-Dufour
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Glad you like Shiny! So yes, I removed the repeat because it was a rare/unused/complicating scenario. What I generally recommend is still injecting the job through AddJob, BUT have a setting class where you can enable/disable via flag. IF you truly want add/remove, you can use the IJobManager to register a job and unregister it when you don't need it. You can also inject the job manager into your job to decide when the unregister should happen. Let me know if that makes sense? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First and foremost, thank you @aritchie (Allan Ritchie) for coming up with Shiny.
I read that if you set JobInfo.IsSystemJob to false, the job should run just once.
bool IsSystemJob = false; //defaults to true, set to false to run once OR set it inside a job to cancel further execution
I did, but my job runs again and again and again. How can I force it to just run one time?
A little hard to follow when the documentation is a bit behind, on https://shinylib.net/client/jobs/create/ there is a mention of setting Repeat to false (property which does no exists anymore). But I totally get it, it takes time to update docs.
Thanks for any help.
Richard
Beta Was this translation helpful? Give feedback.
All reactions