8

I am using FluentScheduler, and have a Registry class,

public class UnreadAlertRegistry : Registry
{
  public UnreadAlertRegistry(int minute, string user, bool? type)
    {

        var alertAction = new Action(() =>
          {
            // show message box 
          }
       Schedule(alertAction).ToRunEvery(minute).Minutes();
     }
  }

and in app, i Initialize it.

alert = new UnreadAlertRegistry(5, _dashboardUser, false);
TaskManager.Initialize(alert);

it is run every 5 minute.

I want to stop this. How do i stop this Scheduler?

1 Answer 1

10

I set a Name for schedule.

Schedule(alertAction).WithName("UnreadAlertRegistry").ToRunEvery(minute).Minutes();

and for stop it , use RemoveTask

TaskManager.RemoveTask("UnreadAlertRegistry");
2
  • 2
    for remove, it seems we need to use JobManager.RemoveJob(''NAME'')
    – Samih A
    May 30, 2018 at 10:26
  • 2
    I confirm that it is now JobManager.RemoveJob("UnreadAlertRegistry");
    – 10101
    Oct 28, 2020 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.