From b5a0214ae5e38b223d79140fd0cd48db509d2780 Mon Sep 17 00:00:00 2001 From: yangxiaodong Date: Wed, 21 Jun 2017 16:06:53 +0800 Subject: [PATCH] add DefaultCronJobRegistry about Cap Job. --- .../Job/CronJobRegistry.Default.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/Cap.Consistency/Job/CronJobRegistry.Default.cs diff --git a/src/Cap.Consistency/Job/CronJobRegistry.Default.cs b/src/Cap.Consistency/Job/CronJobRegistry.Default.cs new file mode 100644 index 0000000..4f6345c --- /dev/null +++ b/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 options) { + _options = options.Value; + + RegisterJob(nameof(DefaultCronJobRegistry), _options.CronExp, RetryBehavior.DefaultRetry); + } + } +}