public virtual void Pause(TimeSpan duration) { //TODO: pause var now = DateTime.Now; var nextStartDate = now.AddSeconds(duration.Seconds); ScheduledTask.StopSchedule(); OnPaused?.Invoke(this, new WorkerPausedEventArgs()); Store($"{Name} has paused at {DateTime.Now}"); }
public virtual bool Stop() { try { ScheduledTask.StopSchedule(); OnStopped?.Invoke(this, new WorkerStoppedEventArgs()); Store($"{Name} has stopped at {DateTime.Now}"); return(true); } catch (Exception exception) { WorkerLogger.Error("", exception); return(false); } }
public void Dispose() { ScheduledTask.StopSchedule(); }