c# - Why isn't this Quartz schedule repeating? -


the job executes once right away doesn't repeat. doing wrong here?

using system; using system.collections.generic; using system.diagnostics; using system.linq; using system.text; using system.threading; using system.threading.tasks; using quartz; using quartz.impl;  namespace quartzconsoleapplication1 {     class program     {         static void main(string[] args)         {             var schedulerfactory = new stdschedulerfactory();              ischeduler scheduler = schedulerfactory.getscheduler();              scheduler.start();              var jobdetail = jobbuilder                                 .create<samplejob>()                                 .withidentity("myjob", "mygroup")                                 .build();              var trigger = triggerbuilder                                 .create()                                 .withidentity("mytrigger", "mygroup")                                 .withsimpleschedule(c => c.withintervalinseconds(10))                                 .build();              scheduler.schedulejob(jobdetail, trigger);              var stopwatch = new stopwatch();             stopwatch.start();             while (true)             {                 console.writeline("running {0}", stopwatch.elapsed.tostring());                 thread.sleep(timespan.fromseconds(10));             }         }     }      public class samplejob : ijob     {         public void execute(ijobexecutioncontext context)         {             console.writeline("execute!");         }     } } 

try adding ".repeatforever()" on schedule.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -