parent
2ebe5a2eb7
commit
ee0854002e
@ -0,0 +1,35 @@
|
|||||||
|
package au.com.royalpay.payment.manage.task;
|
||||||
|
|
||||||
|
import au.com.royalpay.payment.manage.dev.core.MerchantLocationService;
|
||||||
|
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by wangning on 2018/1/2.
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true")
|
||||||
|
public class initClientLocationTask {
|
||||||
|
@Resource
|
||||||
|
private MerchantLocationService merchantLocationService;
|
||||||
|
@Resource
|
||||||
|
private SynchronizedScheduler synchronizedScheduler;
|
||||||
|
|
||||||
|
@Scheduled(cron = "0 0 5 * * *")
|
||||||
|
public void checkBillOrderCheck() {
|
||||||
|
synchronizedScheduler.executeProcess("manage_task:initClientLocation", 120_000, () -> {
|
||||||
|
try {
|
||||||
|
merchantLocationService.initClientLocations();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue