package com.foreverwin.mesnac.quartz.job;

import org.quartz.*;

/**
 * @author Ervin Chen
 * @date 2020/10/22 15:18
 */
@DisallowConcurrentExecution
public class TestJob implements Job {

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        long startTime = System.currentTimeMillis();
        JobDataMap dataMap = jobExecutionContext.getMergedJobDataMap();
        System.out.println("任务开始");
        String site = dataMap.getString("SITE");
        System.out.println("任务参数：" + site);
        long endTime = System.currentTimeMillis();
        System.out.println("任务结束,运行时间："+ (endTime - startTime));
    }
}
