Browse Source

add DefaultCronJobRegistry about Cap Job.

master
yangxiaodong 7 years ago
parent
commit
b5a0214ae5
1 changed files with 19 additions and 0 deletions
  1. +19
    -0
      src/Cap.Consistency/Job/CronJobRegistry.Default.cs

+ 19
- 0
src/Cap.Consistency/Job/CronJobRegistry.Default.cs View File

@@ -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…
Cancel
Save