0
thanhlg created
6 Answer(s)
-
0
Hi,
This is because the period is too long.
You can check this logic https://github.com/abpframework/abp/blob/OrganizationUnitEto/framework/src/Volo.Abp.BackgroundWorkers.Hangfire/Volo/Abp/BackgroundWorkers/Hangfire/HangfireBackgroundWorkerManager.cs#L80-L101
-
0
In my previous code, I used Cron.Daily(8, 0) because I wanted to perform a task every day at 8 AM. After reviewing the file you sent me, I tried using CronExpression = $"*/50 * * * * *"; but the error still persists. Could you please let me know where I went wrong? And why does it work in version 8.1.3 but not in version 8.2.0?
-
0
i will check it
-
0
Hi,
You can try this, i will fix it in the next patch version.
[Dependency(ReplaceServices = true)] [ExposeServices(typeof(IBackgroundWorkerManager), typeof(HangfireBackgroundWorkerManager))] public class MyHangfireBackgroundWorkerManager: HangfireBackgroundWorkerManager { public MyHangfireBackgroundWorkerManager(IServiceProvider serviceProvider) : base(serviceProvider) { } protected override string GetCron(int period) { var time = TimeSpan.FromMilliseconds(period); string cron; if (time.TotalSeconds <= 59) { cron = $"*/{time.TotalSeconds} * * * * *"; } else if (time.TotalMinutes <= 59) { cron = $"*/{time.TotalMinutes} * * * *"; } else if (time.TotalHours <= 23) { cron = $"0 */{time.TotalHours} * * *"; } else if(time.TotalDays >= 1) { cron = $"0 0 0 1/{time.TotalDays} * *"; } else { throw new AbpException( $"Cannot convert period: {period} to cron expression, use HangfireBackgroundWorkerBase to define worker"); } return cron; } }
-
0
-
0
could you create a new ticket, thanks