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}
|
||||
}
|
||||
|
||||
Dim oJobDetail = JobBuilder.Create(Of T)().
|
||||
Dim oJob = JobBuilder.Create(Of T)().
|
||||
WithIdentity(oJobIdentity).
|
||||
UsingJobData(oJobData).
|
||||
Build()
|
||||
@ -76,7 +76,7 @@ Public Class JobRunner
|
||||
Build()
|
||||
|
||||
If oJobConfig.Enabled Then
|
||||
Await _scheduler.ScheduleJob(oJobDetail, oTrigger)
|
||||
Await _scheduler.ScheduleJob(oJob, oTrigger)
|
||||
|
||||
_Logger.Info("Job {0} scheduled.", JobName)
|
||||
Else
|
||||
@ -85,13 +85,18 @@ Public Class JobRunner
|
||||
|
||||
' If StartImmediately is True, start Job after 10 Seconds
|
||||
If oJobConfig.StartImmediately Then
|
||||
Dim oDebugJob = JobBuilder.Create(Of T)().
|
||||
WithIdentity(oJobIdentity & "-DEBUG").
|
||||
UsingJobData(oJobData).
|
||||
Build()
|
||||
|
||||
Dim oDebugTrigger = TriggerBuilder.Create().
|
||||
WithIdentity(oTriggerIdentity & "-DEBUG").
|
||||
StartAt(DateBuilder.FutureDate(10, IntervalUnit.Second)).
|
||||
Build()
|
||||
|
||||
_Logger.Info("Job {0} will start in 10 Seconds.", JobName)
|
||||
Await _scheduler.ScheduleJob(oJobDetail, oDebugTrigger)
|
||||
Await _scheduler.ScheduleJob(oDebugJob, oDebugTrigger)
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user