Quartz.net Cron触发某些时区不起作用
我正在使用MassTransit.Quarts库和.NET Core来安排一些将属于不同时区的作业。我要注意的是,预定的作业是针对某些时区而不是其他时区触发的。
以下是我使用MassTransit库来安排工作的方式:
public async Task ScheduleRecurringMessage<T>(string destinationAddress, string scheduleId, string scheduledGroupId, string timeZoneId, DateTimeOffset startTime, DateTimeOffset? endTime, string cronExpression, T message) where T : class
{
var destinationUri = string.Format("rabbitmq://{0}/{1}.{2}", eventbusConfig.Value.EventBusUri, eventbusConfig.Value.EventBusEndpointName, destinationAddress);
var recurringSchedule = new MasstransitRecurringSchedule(timeZoneId, startTime, endTime, scheduleId, scheduledGroupId, cronExpression);
await sendEndpoint.ScheduleRecurringSend<T>(new Uri(destinationUri), recurringSchedule, message);
}
但是,当我检查[QRTZ_CRON_TRIGGERS]表时,我可以看到所有计划的作业都可以在此处正确记录在此处,并针对正确的时区。但是,UTC-时区(例如EST),调度程序并未将事件触发到RabbitMQ。
谁能帮助我身份为什么会发生这种情况?
I'm using masstransit.quarts library with .NET Core to schedule some jobs that would fall under different timezones. What I'm observing is, the scheduled jobs get triggered for certain timezone and not for the others.
Following is how I use the masstransit library to schedule the job:
public async Task ScheduleRecurringMessage<T>(string destinationAddress, string scheduleId, string scheduledGroupId, string timeZoneId, DateTimeOffset startTime, DateTimeOffset? endTime, string cronExpression, T message) where T : class
{
var destinationUri = string.Format("rabbitmq://{0}/{1}.{2}", eventbusConfig.Value.EventBusUri, eventbusConfig.Value.EventBusEndpointName, destinationAddress);
var recurringSchedule = new MasstransitRecurringSchedule(timeZoneId, startTime, endTime, scheduleId, scheduledGroupId, cronExpression);
await sendEndpoint.ScheduleRecurringSend<T>(new Uri(destinationUri), recurringSchedule, message);
}
However, when I check the [QRTZ_CRON_TRIGGERS] table, I can see that all scheduled jobs get correctly recorded here, against the correct timezone. However, UTC- timezones (e.g. EST), the scheduler doesnt trigger the event to Rabbitmq.
Can anyone help me identity why this is happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论