package com.friday.distributor.qrtzjob;

import com.friday.distributor.service.DistributorService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;

@Slf4j
@DisallowConcurrentExecution
public class TaskPollingJob extends QuartzJobBean {

    @Autowired
    private DistributorService distributorService;

    @Override
    protected void executeInternal(JobExecutionContext context) {
        this.distributorService.startQueuePolling();
    }
}
