It would be really cool if one could register jobs that will show up in the dashboard but can only be launched manually, e.g. ManualJob.AddOrUpdate<IMyService>(service => service.DoOneTimeStuff()).
I have tried hacking it with e.g. recurring jobs with CRON expressions for 31st of February, but Hangfire crashes.
I'd be interested in this as well.
interesting how you want to pass in the job arguments then. the dashboard should also facilitate that.
the feature sure is interesting, in my current project we build a mvc pages which can handle our non scheduled job starting. another scenerio is making a POST request to the dashboard to start a job, so a more JS style app can take care.
I'd like to have something like that as well, for example
jobId = BackgroundJob.Stash<IMyService>(service => service.DoOneTimeStuff());
DoOtherStuff();
BackgroundJob.Enqueue(jobId);
+1
Hi Carlos,
I mean it would be nice to have something scheduled somewhere, but
trigerred manually - even from a different service. If you mean something
like that on "Manual Update", then yes. :)
Best,
Kornél
2015-11-29 23:05 GMT+01:00 Carlos Henrique Guardão Gandarez <
[email protected]>:
+1
—
Reply to this email directly or view it on GitHub
https://github.com/HangfireIO/Hangfire/issues/382#issuecomment-160475354
.
Kornél Bálint Kátai
Software Developer
Sonrisa Kft
H-1022 Budapest, Bég u. 3-5., HUNGARY
@kataik I'll try to do something related to it into my branch "manual-job"
https://github.com/gandarez/Hangfire/tree/manual-job
@geirsagberg @smhinsey @vip32 @kataik
Hey guys I've done 99% of the new Manual State job. Please refer to https://github.com/gandarez/Hangfire/commit/830f3ebe87ad2432959978bdca7ab4cfe201b8a7
C#
BackgroundJob.Stash(() => Console.WriteLine("STASHING"));
a meaningful addition. will your solution be merged? seems like it cannot work as a standalone extension.
@vip32 I didn't do PR yet!
Could you please clone my repo and try by yourself?
https://github.com/gandarez/Hangfire/tree/manual-job
Has this ever been merged into the main branch? This is a very valuable addition..
Hi @geirsagberg @smhinsey @vip32 @kataik @gandarez,
What is the status of this issue?
Client asked for such a thing in my project...
Doesn't look like anything is merged yet, and no PR has been made. The next steps would be for someone to:
I'd do it myself, but unfortunately cannot prioritize this at the moment.
Thanks for reply!
I'll ask whether I can do it as work for my client, then I'm able to do it soon.
Eventually, but I cannot guarantee when, I can do it in my free time.
You can now create recurring jobs that never occur by choosing some great date like Feb 31 for cron expression, and those jobs will be placed at the top of the list in the dashboard.
Thanks for information :).
RecurringJob.AddOrUpdate(() => new MyJob().Execute(), Cron.Never);
Thanks @Recodify - for anyone else the job appears in the dashboard as "DISABLED" but can be executed through the dashboard UI.
I'd argue you don't need a specific feature? Perhaps updating the documentation would be sufficient?
Most helpful comment
RecurringJob.AddOrUpdate(() => new MyJob().Execute(), Cron.Never);