yuzd / Hangfire.HttpJob

httpjob for Hangfire,restful api for Hangfire,job调度与业务分离
https://github.com/yuzd/Hangfire.HttpJob/wiki
MIT License
626 stars 185 forks source link

能增加一个JobId字段吗、用JobName代替比较不好。 #78

Closed Lflying-NRSoft closed 3 years ago

Lflying-NRSoft commented 3 years ago

//支持添加一个 只能手动出发的 RecurringJob.AddOrUpdate(jobItem.JobName, () => HttpJob.Excute(jobItem, jobItem.JobName, queueName, jobItem.EnableRetry, null), Cron.Never, timeZone, jobItem.QueueName.ToLower());

因为跟我们系统业务对接时,生成定时任务的时候会指定一个JobId,如果要停用任务的时候,就需要传入JobId。

Lflying-NRSoft commented 3 years ago

如果改动太大,是否可以增加一个 JobDisplayName

yuzd commented 3 years ago

我研究下

yuzd commented 3 years ago

你指的是用代码来创建jobagent的时候是把?

Lflying-NRSoft commented 3 years ago

嗯,是的,我是用的代码来创建任务的。操作的对象是:HttpJobDispatcher

var result = _httpJobDispatcher.AddHttprecurringjob(httpJobItem);

Lflying-NRSoft commented 3 years ago

嗯,是的。我是用 HttpJobDispatcher 这个对象来创建任务的。

var result = _httpJobDispatcher.AddHttprecurringjob(httpJobItem);

yuzd commented 3 years ago

你这个是用dashbord上创建的把

yuzd commented 3 years ago

最新版本的话 如果你是client端代码创建的话 请传 RecurringJobIdentifier 参数

如果你使用dashbord上创建 可以 自己加个 RecurringJobIdentifier 参数

image