/// <summary>
 /// 执行任务
 /// </summary>
 /// <param name="method"></param>
 public void Excete <T>(Action method, WorkerConfig config) where T : IBackgroundWorkerDo
 {
     config.IntervalSecond = config.IntervalSecond == 0 ? 3600 : config.IntervalSecond;
     ExetuteMethod         = method;
     Timer.Period          = config.IntervalSecond * 1000;//将传入的秒数转化为毫秒
     Timer.Start();
 }
 public override void Start()
 {
     base.Start();
     Timer.Start();
 }
 public void Start()
 {
     timer.Start();
 }
Exemplo n.º 4
0
        public override async Task StartAsync(CancellationToken cancellationToken = default)
        {
            await base.StartAsync(cancellationToken);

            Timer.Start(cancellationToken);
        }