Is there a way to know if a recurring job has been launched manually?

recurring
Tags: #<Tag:0x00007f21e4755528>

#1

Hello,

My application registers some recurring jobs at startup.
Theses jobs can be

  • normally executed, at the defined frequency
  • or be force to be executed, if someone of my support team used the “Trigger now” action of the “Recurring jobs” page of HangFire Dashboard.

When the job is launched : is there a way to know if it’s a normal execution (at frequency) or is a special execution (launched by using the HangFire DashBoard) ?


#2

Nope, there’s no difference between scheduled and manual launch.


#3

@VyTre Yes, there is.


as you can see, even the Dashboard differentiates how the jobs was started.
The one that states Triggered using recurring job manager is a manual execution.

This information is stored on the Reason field of the State table