瀏覽代碼

add DefaultCronJobRegistry about Cap Job.

master
yangxiaodong 7 年之前
父節點
當前提交
b5a0214ae5
共有 1 個檔案被更改,包括 19 行新增0 行删除
  1. +19
    -0
      src/Cap.Consistency/Job/CronJobRegistry.Default.cs

+ 19
- 0
src/Cap.Consistency/Job/CronJobRegistry.Default.cs 查看文件

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
using Cap.Consistency.Infrastructure;
using Microsoft.Extensions.Options;

namespace Cap.Consistency.Job
{
public class DefaultCronJobRegistry : CronJobRegistry
{
private readonly ConsistencyOptions _options;

public DefaultCronJobRegistry(IOptions<ConsistencyOptions> options) {
_options = options.Value;

RegisterJob<CapJob>(nameof(DefaultCronJobRegistry), _options.CronExp, RetryBehavior.DefaultRetry);
}
}
}

Loading…
取消
儲存