JobRunner: fix debug not working because of duplicate job definitions
This commit is contained in:
parent
6d243bff89
commit
1b38141e3e
@ -64,7 +64,7 @@ Public Class JobRunner
|
|||||||
{"Args", oJobConfig.Arguments}
|
{"Args", oJobConfig.Arguments}
|
||||||
}
|
}
|
||||||
|
|
||||||
Dim oJobDetail = JobBuilder.Create(Of T)().
|
Dim oJob = JobBuilder.Create(Of T)().
|
||||||
WithIdentity(oJobIdentity).
|
WithIdentity(oJobIdentity).
|
||||||
UsingJobData(oJobData).
|
UsingJobData(oJobData).
|
||||||
Build()
|
Build()
|
||||||
@ -76,7 +76,7 @@ Public Class JobRunner
|
|||||||
Build()
|
Build()
|
||||||
|
|
||||||
If oJobConfig.Enabled Then
|
If oJobConfig.Enabled Then
|
||||||
Await _scheduler.ScheduleJob(oJobDetail, oTrigger)
|
Await _scheduler.ScheduleJob(oJob, oTrigger)
|
||||||
|
|
||||||
_Logger.Info("Job {0} scheduled.", JobName)
|
_Logger.Info("Job {0} scheduled.", JobName)
|
||||||
Else
|
Else
|
||||||
@ -85,13 +85,18 @@ Public Class JobRunner
|
|||||||
|
|
||||||
' If StartImmediately is True, start Job after 10 Seconds
|
' If StartImmediately is True, start Job after 10 Seconds
|
||||||
If oJobConfig.StartImmediately Then
|
If oJobConfig.StartImmediately Then
|
||||||
|
Dim oDebugJob = JobBuilder.Create(Of T)().
|
||||||
|
WithIdentity(oJobIdentity & "-DEBUG").
|
||||||
|
UsingJobData(oJobData).
|
||||||
|
Build()
|
||||||
|
|
||||||
Dim oDebugTrigger = TriggerBuilder.Create().
|
Dim oDebugTrigger = TriggerBuilder.Create().
|
||||||
WithIdentity(oTriggerIdentity & "-DEBUG").
|
WithIdentity(oTriggerIdentity & "-DEBUG").
|
||||||
StartAt(DateBuilder.FutureDate(10, IntervalUnit.Second)).
|
StartAt(DateBuilder.FutureDate(10, IntervalUnit.Second)).
|
||||||
Build()
|
Build()
|
||||||
|
|
||||||
_Logger.Info("Job {0} will start in 10 Seconds.", JobName)
|
_Logger.Info("Job {0} will start in 10 Seconds.", JobName)
|
||||||
Await _scheduler.ScheduleJob(oJobDetail, oDebugTrigger)
|
Await _scheduler.ScheduleJob(oDebugJob, oDebugTrigger)
|
||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user