fluentscheduler / FluentScheduler

Automated job scheduler with fluent interface for the .NET platform.
Other
2.68k stars 410 forks source link

run all other jobs after one job is done #308

Closed sjokoladepudding closed 3 years ago

sjokoladepudding commented 3 years ago

here's my code today:

public class JobRegistry : Registry
    {
        public JobRegistry(IEnumerable<IJobSpecification> jobs)
        {
            foreach (var job in jobs)
            {
                Schedule(() => job).ToRunNow().AndEvery(job.JobConfiguration.RunEverySeconds.Value).Seconds();
            }
        }
    }

i wonder if it's possible to have a job added which every else job has to wait to finish. Maybe a new schedule that runs always before the other schedule.

Is it possible to have like a Schedule(() => initjobs).AndThen(asyncjobs).RunWholeThingWithInitialJobsEveryMinutes..

sjokoladepudding commented 3 years ago

I'll just make a global lock or something