Jobs: Add option to start jobs immediately
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Jobs
|
||||
Imports DigitalData.Modules.Logging
|
||||
@@ -78,10 +77,22 @@ Public Class JobRunner
|
||||
|
||||
If oJobConfig.Enabled Then
|
||||
Await _scheduler.ScheduleJob(oJobDetail, oTrigger)
|
||||
_Logger.Info("Job {0} started.", JobName)
|
||||
|
||||
_Logger.Info("Job {0} scheduled.", JobName)
|
||||
Else
|
||||
_Logger.Info("Job {0} is disabled.", JobName)
|
||||
End If
|
||||
|
||||
' If StartImmediately is True, start Job after 10 Seconds
|
||||
If oJobConfig.StartImmediately Then
|
||||
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)
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Async Sub [Stop]()
|
||||
@@ -92,7 +103,7 @@ Public Class JobRunner
|
||||
Private Class LogProvider
|
||||
Implements ILogProvider
|
||||
|
||||
Private _Logger As DigitalData.Modules.Logging.Logger
|
||||
Private _Logger As Modules.Logging.Logger
|
||||
|
||||
Public Sub New(Logger As DigitalData.Modules.Logging.Logger)
|
||||
MyBase.New()
|
||||
|
||||
Reference in New Issue
Block a user