What would be the steps required to change all dates to UTC format on Angular + .NET Core solution?
How to disable logging of all events in Logs file and only keep exception logs and logs that are added by Logger
?
Is it possible to write Logger
logs in seperate log files?
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
}
I have a static class called Generic Helper. How can I use L
in the static class?
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?
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?
Hi,
I am planning to create an ionic capacitor app on top of AspNetZero Angular frontend. For the app to work, I need to enable CORS.
The capacitor wraps the app in a webview and runs the app localhost:9222. Should I just add this URL to the CORS list in appsettings.json? Is this a good approach?