标签:mon class instance elements ora hlist set dict boa
public class Startup
{
public void Configuration(IAppBuilder app)
{
//指定Hangfire使用内存存储后台任务信息
GlobalConfiguration.Configuration.UseMemoryStorage();
app.UseHangfireServer();
app.UseHangfireDashboard();
SetJobs();
}
private static void SetJobs()
{
string UmengMsgPushList = CommonMethod.GetAppSetting("UmengMsgPush");
String[] elementsUmengMsgPush = UmengMsgPushList.Split(‘|‘);
InitUmengMsgPush initUmengMsgPush = new InitUmengMsgPush();
int sum = 0;
foreach (var item in elementsUmengMsgPush)
{
if (!string.IsNullOrEmpty(item))
{
MsgPushInstance msgPushInstance = initUmengMsgPush.GetmsgPushInstance(item);
List<MsgPushParameter> msgPushParameterList = msgPushInstance.GetMsgPushParameter();
foreach (var msgPushParameter in msgPushParameterList)
{
RecurringJob.AddOrUpdate("job" + item + sum, () => msgPushInstance.PushMsgByUID(msgPushParameter.Medictimeslotid), Cron.Daily(msgPushParameter.Hour, msgPushParameter.Minute), TimeZoneInfo.Local, "default");
sum++;
}
}
}
}
可以利用.../hangfire/recurring查看定时任务
标签:mon class instance elements ora hlist set dict boa
原文地址:http://www.cnblogs.com/xinbaba/p/6914209.html