hangfire

How can I safely reset Hangfire to a clean state?

别来无恙 提交于 2019-12-04 20:42:45
问题 I have a server with Hangfire installed. I haven't checked it for a while and it seems one recurring job has gone rogue. It stopped working and then it has stacked up with retries resulting in a complete lock it seems. I would like to clear my database and start over. Can i just delete the data from all tables or should I drop the tables and let Hangfire recreate them for me? Am I risking anything by doing this? Hangfire.State using entire Azure Basic database 2GB of space. 回答1: I ended up

Recycle of App Pool kills Kestrel but does not restart

泄露秘密 提交于 2019-12-04 09:07:01
Background When hosting a (non-Core) ASP.net site on IIS 8+ it is possible to utilize the IIS Application Initialization Module to pro-actively initialize ('warm-up') a web application when IIS starts up (or, I believe, when an app pool is recycled). As far as I know, this is not possible when hosting a .net Core app on IIS. I have also noticed that when hosting a .net Core (1.1) app on IIS, the dotnet.exe process (Kestrel) is killed as part of an application pool recycle event. This process is then only restarted when the first new request is made. I'm asking the below questions because I am

Is there an in memory job storage package for Hangfire?

走远了吗. 提交于 2019-12-04 00:07:27
I have a console application to test HangFire. Here is the code: using System; using Hangfire; namespace MyScheduler.ConsoleApp { internal static class Program { internal static void Main(string[] args) { MyMethod(); Console.WriteLine("[Finished]"); Console.ReadKey(); } private static void MyMethod() { RecurringJob.AddOrUpdate(() => Console.Write("Easy!"), Cron.Minutely); } } } But it throws an exception on runtime: Additional information: JobStorage.Current property value has not been initialized. You must set it before using Hangfire Client or Server API. So I need a job storage to run this.

Hangfire - Multi tenant, ASP.NET Core - Resolving the correct tenant

巧了我就是萌 提交于 2019-12-03 22:47:53
问题 I got a SaaS project that needs the use Hangfire. We already implemented the requirements to identify a tenant. Architecture Persistence Layer Each tenant has it's own database .NET Core We already have a service TenantCurrentService which returns the ID of the tenant, from a list of source [hostname, query string, etc] We already have a DbContextFactory for Entity Framework which return a DB context with the correct connection string for the client We are currently using ASP.NET Core DI

How can I safely reset Hangfire to a clean state?

元气小坏坏 提交于 2019-12-03 13:47:38
I have a server with Hangfire installed. I haven't checked it for a while and it seems one recurring job has gone rogue. It stopped working and then it has stacked up with retries resulting in a complete lock it seems. I would like to clear my database and start over. Can i just delete the data from all tables or should I drop the tables and let Hangfire recreate them for me? Am I risking anything by doing this? Hangfire.State using entire Azure Basic database 2GB of space. I ended up dropping the tables, at first the query did not work at all, it just kept going and nothing happened. I then

Hangfire.Autofac with MVC app - injection fails

泪湿孤枕 提交于 2019-12-03 11:07:25
I'm trying to create a simple Hangfire test but it's not working. Here's all the important code, and how I've configured it with the Hangire.Autofac . Not sure what I'm missing here. The exception I'm getting in the /hangfire dashbaord is below also. public class AmazonSqsService : IAmazonSqsService { private readonly IBackgroundJobClient _backgroundJobClient; private readonly ILogService _logService; public AmazonSqsService(IBackgroundJobClient backgroundJobClient, ILogService logService) { _backgroundJobClient. = backgroundJobClient; _logService= logService; } public async Task<string> Test(

Hangfire failes to load assembly

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Context I have two application in place, one is my main enterprise application and in other I have hangfire (hangfire server, client and dashboard) hosted. My main application also use hangfire for some long task and executes them asynchronously. Both using the same DB for HF storage. And there is only one HF server. Issue I am getting the following errors intermittently - "Can not change the state to 'Processing': target method was not found." OR "Can not change the state to 'Enqueued': target method was not found." with following details -

HangFire recurring task data

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am coding a MVC 5 internet application and am using HangFire for recurring tasks. If I have a Monthly recurring task, how can I get the value of the next execution time? Here is my code for the recurring task: RecurringJob.AddOrUpdate("AccountMonthlyActionExtendPaymentSubscription", () => accountService.AccountMonthlyActionExtendPaymentSubscription(), Cron.Monthly); I can retrieve the job data as follows: using (var connection = JobStorage.Current.GetConnection()) { var recurringJob = connection.GetJobData(

Why is Hangfire requiring authentication to view dashboard

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am running HangFire within my MVC web app but whenever I try to navigate to http://MyApp/hangfire , it redirects me to my app's login page as though I am not logged in. I have not explicitly configured any requirements for authorization...e.g. I had the below in the web.config, but then took it out in attempts to get this to work. In theory, this is what I'd want, and when I log into my main web application, I will be logged in with an Administrator role so this rule should work. But whether I have that configured in the web.config or not,

Hangfire Dashboard Authorization Config Not working

匿名 (未验证) 提交于 2019-12-03 00:46:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've downloaded the nu-get package Hangfire.Dashboard.Authorization I'm trying configure the OWIN based authorization as per the docs as follows but I get intellisense error DashboardOptions.AuthorizationFilters is obsolete please use Authorization property instead I also get intellisense error The type or namespace AuthorizationFilter and ClaimsBasedAuthorizationFilterd not be found using Hangfire.Dashboard; using Hangfire.SqlServer; using Owin; using System; namespace MyApp { public class Hangfire { public static void ConfigureHangfire