Subversion Repositories SmartDukaan

Rev

Rev 23794 | Rev 23865 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
23756 amit.gupta 1
package com.smartdukaan.cron.scheduled;
2
 
3
import org.apache.logging.log4j.LogManager;
4
import org.apache.logging.log4j.Logger;
5
import org.springframework.beans.factory.annotation.Autowired;
6
import org.springframework.scheduling.annotation.Scheduled;
7
import org.springframework.stereotype.Component;
8
 
9
import com.smartdukaan.cron.migrations.RunOnceTasks;
10
import com.smartdukaan.cron.monitored.NagiosMonitorTasks;
11
 
12
@Component
13
public class ScheduledSkeleton {
23794 govind 14
 
23756 amit.gupta 15
	private static final Logger log = LogManager.getLogger(ScheduledSkeleton.class);
16
 
17
	@Autowired
18
	ScheduledTasks scheduledTasks;
19
 
20
	@Autowired
21
	NagiosMonitorTasks nagiosMonitorTasks;
22
 
23
	@Autowired
24
	RunOnceTasks runOnceTasks;
25
 
23761 amit.gupta 26
	@Scheduled(cron = "0 15 0 * * *")
23756 amit.gupta 27
	public void reconcileRecharge() throws Exception {
28
		scheduledTasks.reconcileRecharge();
29
	}
30
 
23759 amit.gupta 31
	@Scheduled(cron = "0 05 0 1,16 * ?")
23756 amit.gupta 32
	public void processRechargeCashback() throws Throwable {
33
		scheduledTasks.processRechargeCashback();
34
	}
23794 govind 35
 
36
	/*
37
	 * Value so big so that it got to run only once.
23756 amit.gupta 38
	 * 
39
	 */
23794 govind 40
	@Scheduled(fixedDelay = 1000 * 60 * 10)
41
	public void migrateLineItems() throws Throwable {
23756 amit.gupta 42
		log.info("Started run Once");
43
		runOnceTasks.migarateLineItemsToNewTable();
44
	}
45
}