Get this erorr in log for long running background job. The job terminated in less than 10 minutes.
Job started at 14:34:21
and server got removed at 14:37:06
.
DEBUG 2019-02-20 14:35:46,479 [51 ] ion.Mg.MgPostInitializationJob - Processing batch
DEBUG 2019-02-20 14:35:54,884 [51 ] ion.Mg.MgPostInitializationJob - Processing batch
DEBUG 2019-02-20 14:36:07,064 [51 ] ion.Mg.MgPostInitializationJob - Processing batch
DEBUG 2019-02-20 14:36:15,531 [51 ] ion.Mg.MgPostInitializationJob - Processing batch
DEBUG 2019-02-20 14:36:23,792 [51 ] ion.Mg.MgPostInitializationJob - Processing batch
DEBUG 2019-02-20 14:36:32,107 [51 ] ion.Mg.MgPostInitializationJob - Processing batch
DEBUG 2019-02-20 14:36:40,601 [51 ] ion.Mg.MgPostInitializationJob - Processing batch
DEBUG 2019-02-20 14:36:48,733 [51 ] ion.Mg.MgPostInitializationJob - Processing batch
DEBUG 2019-02-20 14:36:57,167 [51 ] ion.Mg.MgPostInitializationJob - Processing batch
INFO 2019-02-20 14:37:06,442 [chdog] Hangfire.Server.ServerWatchdog - 1 servers were removed due to timeout
Job class:
public class MgPostInitializationJob : BackgroundJob<MgPostInitializationJobArgs>, ITransientDependency
{
// My code here
}
// Hangfire dashboard & server (Enable to use Hangfire instead of default job manager)
var dashboardOptions = new DashboardOptions
{
Authorization = new[] { new AbpHangfireAuthorizationFilter(AppPermissions.Pages_Administration_HangfireDashboard) }
};
app.UseHangfireDashboard("/hangfire", DebugHelper.IsDebug ? null : dashboardOptions);
app.UseHangfireServer();
It will be a good idea to secure thr hangfire url for production
Hi @aaron.
How can I pass parameters as in L('name', parameters) using LocalizationHelper
? Can't find any way.
I have a static class called Generic Helper. How can I use L
in the static class?
@ismcagdas, I'm sending 1100 from client app. I guess that would be the last option then :)
I'm using Angular frontend.
I have class:
class GetInventoryListInput : PagedAndSortedInputDto
I tried to override MaxResultCount
property in constructor and also as new MaxResultCount
. In this case, I always get 10 result.
I tried with [DisableValidation]
but still get the error:
The field MaxResultCount must be between 1 and 1000.
How can I override MaxResultCount
for 1 single call?
That works @maliming. Tricky code thhough :D
Hi,
I am trying to configure dependency injection for DinkToPdf package but not sure how to register dependency this way: https://github.com/rdvojmoc/DinkToPdf#dependency-injection
services.AddSingleton(typeof(IConverter), new SynchronizedConverter(new PdfTools()));
How can I register this in CoreModule?
I have added a Hangfire
service class which initialize all hangfire jobs in my application.
public class HangfireService
{
public static void InitializeJobs()
{
RecurringJob.AddOrUpdate<DelayedNotificationWorker>(job => job.Start(), Cron.HourInterval(6));
}
}
Here is DelayedNotificationWorker
class:
public class DelayedNotificationWorker : PeriodicBackgroundWorkerBase, ISingletonDependency
{
private readonly IAppNotifier _appNotifier;
private readonly UserManager _userManager;
private readonly IRepository<DelayedNotification, long> _delayedNotificationRepository;
public DelayedNotificationWorker(
AbpTimer timer,
IRepository<DelayedNotification, long> delayedNotificationRepository) : base(timer)
{
Timer.Period = 1000 * 60 * 60 * 6; // 6 Hours
_delayedNotificationRepository = delayedNotificationRepository;
}
[UnitOfWork]
protected override void DoWork()
{
// Do some job
}
}
What is the effect of application restart on the background job? Will it be triggered immediately on restart or wait for 6 hour interval? What is the role of Timer.Period
in this class?