I'm using Quartz.NET 3
as a job scheduler in my application
Sometimes, I need to schedule a job for a "one time" immediate execution. At the moment I'm doing it like this:
//Create job
var uid = Guid.NewGuid().ToString();
IJobDetail jobDetail = JobBuilder.Create<MyJobClass>()
.WithIdentity(uid, "ImmediateJobs")
.Build();
//Create instant-activation trigger
ITrigger trigger = TriggerBuilder.Create()
.WithIdentity("trigger-" + uid, "ImmediateJobsTriggers")
.StartNow()
.Build();
//Schedule job for execution
scheduler.ScheduleJob(jobDetail, trigger);
My question is this: is this enough or does this cause possibile memory leaks? Should I somehow remove the job when finished or do any other cleanup operations? Or is it done automatically, since the job doesn't have any other triggers?