C# QuartzHelper 封装Quartz 简化操作流程

发布时间:2024年01月18日
 using Quartz;
using Quartz.Impl;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MPC.AFE.Controller.Service;

public static class QuartzHelper
{
   
    private static ISchedulerFactory scheduleFactory = null;
    private static IScheduler _scheduler = null;

    public static async Task InitAsync()
    {
   
        scheduleFactory = new StdSchedulerFactory();
        _scheduler = await scheduleFactory.GetScheduler();
    }


    public static async Task AddSimpleJobOfSecondAsync<T>(string jobName, string groupName, int second, Dictionary
    <string, object>param = null) where T : IJob
    {
   
        await AddSimpleJobAsync
        <T>(jobName, groupName, (
文章来源:https://blog.csdn.net/weixin_44291381/article/details/135675437
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。