0

I use hangfire on a .net core project, (vs:1.7.34) I want to trigger recurring job from the hangfire dashboard UI, There was a button before was showing "Trigger Now" but not showing trigger button now, maybe after I upgrade the hangfire version I guess. How to enable it and trigger jobs from dashboard manually?

settings like tihs;

public static class HangfireHelper
{
    public static void AddHangfire(IServiceCollection services, string connectionString, string recurrence)
    {
        services.AddHangfire(x =>
        {
            x.UsePostgreSqlStorage(connectionString);
            RecurringJob.AddOrUpdate<MyClass>(e => e.MyMethodToExecute(), recurrence);
        });

        services.AddHangfireServer(ops =>
        {
            ops.ServerName = "my job server";
            ops.WorkerCount = 10;                
            ops.Queues = new string[] { "general" };
            ops.SchedulePollingInterval = TimeSpan.FromSeconds(10);
            ops.CancellationCheckInterval = TimeSpan.FromSeconds(10);
        });

    }
}
1
  • It is possible you implemented access restrictions in your hangfire settings that prevents you from executions. ReadOnly would do that
    – Jawad
    Commented May 4, 2023 at 1:44

1 Answer 1

0

https://docs.hangfire.io/en/latest/configuration/using-dashboard.html#read-only-view

In my case I had to set IsReadOnlyFunc to true and then I could trigger jobs from the dashboard manually

New contributor
Albert Szymański is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

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