|
@@ -19,10 +19,10 @@ namespace EVCB_OCPP.TaskScheduler
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- logger.Info("running....");
|
|
|
|
|
|
+ logger.Info("running....");
|
|
|
|
|
|
DoHardWork().GetAwaiter().GetResult();
|
|
DoHardWork().GetAwaiter().GetResult();
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|
|
@@ -38,10 +38,10 @@ namespace EVCB_OCPP.TaskScheduler
|
|
try
|
|
try
|
|
{
|
|
{
|
|
// Grab the Scheduler instance from the Factory
|
|
// Grab the Scheduler instance from the Factory
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
IScheduler scheduler = await StdSchedulerFactory.GetDefaultScheduler();
|
|
IScheduler scheduler = await StdSchedulerFactory.GetDefaultScheduler();
|
|
-
|
|
|
|
|
|
+
|
|
// and start it off
|
|
// and start it off
|
|
await scheduler.Start();
|
|
await scheduler.Start();
|
|
|
|
|
|
@@ -66,6 +66,11 @@ namespace EVCB_OCPP.TaskScheduler
|
|
.WithIdentity("job5", "group1")
|
|
.WithIdentity("job5", "group1")
|
|
.Build();
|
|
.Build();
|
|
|
|
|
|
|
|
+
|
|
|
|
+ IJobDetail _ResetChargerJob = JobBuilder.Create<ResetChargerJob>()
|
|
|
|
+ .WithIdentity("job6", "group1")
|
|
|
|
+ .Build();
|
|
|
|
+
|
|
// Trigger the job to run now, and then repeat every 10 seconds
|
|
// Trigger the job to run now, and then repeat every 10 seconds
|
|
ITrigger _CheckEVSEOnlineTrigger = TriggerBuilder.Create()
|
|
ITrigger _CheckEVSEOnlineTrigger = TriggerBuilder.Create()
|
|
.WithIdentity("trigger1", "group1")
|
|
.WithIdentity("trigger1", "group1")
|
|
@@ -108,12 +113,21 @@ namespace EVCB_OCPP.TaskScheduler
|
|
.RepeatForever())
|
|
.RepeatForever())
|
|
.Build();
|
|
.Build();
|
|
|
|
|
|
|
|
+
|
|
|
|
+ ITrigger _ResetChargerTrigger = TriggerBuilder.Create()
|
|
|
|
+ .WithIdentity("trigger6", "group1")
|
|
|
|
+ .StartNow()
|
|
|
|
+ .WithCronSchedule("0 51 18 ? * THU")
|
|
|
|
+ .Build();
|
|
|
|
+
|
|
// Tell quartz to schedule the job using our trigger
|
|
// Tell quartz to schedule the job using our trigger
|
|
- await scheduler.ScheduleJob(_CheckEVSEOnlineJob, _CheckEVSEOnlineTrigger);
|
|
|
|
- await scheduler.ScheduleJob(_StartTransacionReportJob, _StartTransacionReportTrigger);
|
|
|
|
- await scheduler.ScheduleJob(_StopTransacionReportJob, _StopTransacionReportTrigger);
|
|
|
|
- await scheduler.ScheduleJob(_CheckExecutionCmdJob, _CheckExecutionCmdTrigger);
|
|
|
|
- await scheduler.ScheduleJob(_ExecutionCmdReportJob, _ExecutionCmdReportTrigger);
|
|
|
|
|
|
+ //await scheduler.ScheduleJob(_CheckEVSEOnlineJob, _CheckEVSEOnlineTrigger);
|
|
|
|
+ //await scheduler.ScheduleJob(_StartTransacionReportJob, _StartTransacionReportTrigger);
|
|
|
|
+ //await scheduler.ScheduleJob(_StopTransacionReportJob, _StopTransacionReportTrigger);
|
|
|
|
+ //await scheduler.ScheduleJob(_CheckExecutionCmdJob, _CheckExecutionCmdTrigger);
|
|
|
|
+ //await scheduler.ScheduleJob(_ExecutionCmdReportJob, _ExecutionCmdReportTrigger);
|
|
|
|
+
|
|
|
|
+ await scheduler.ScheduleJob(_ResetChargerJob, _ResetChargerTrigger);
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|