package com.salpa.web.job;

import com.salpa.subject.service.DocumentService;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

public class ProjectSyncJob implements Job {

    @Autowired
    private DocumentService documentService;

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        JobDataMap dataMap = context.getMergedJobDataMap();
        Integer projectId = dataMap.getInt("projectId");
        try {
            documentService.createSyncTask(projectId, (long)-1, true);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
