jj appserv
This commit is contained in:
@@ -33,9 +33,9 @@ Public Class Scheduler
|
||||
_MSSQL = MSSQL_ECM
|
||||
|
||||
Dim oDataSet As New DataSet()
|
||||
_JobListener = New JobListener(LogConfig, oDataSet)
|
||||
_JobListener = New JobListener(LogConfig, _MSSQL, oDataSet)
|
||||
|
||||
Quartz.Logging.LogProvider.SetCurrentLogProvider(New LogProvider(_Logger))
|
||||
Logging.LogProvider.SetCurrentLogProvider(New LogProvider(_Logger))
|
||||
End Sub
|
||||
|
||||
Public Async Sub Start()
|
||||
@@ -66,18 +66,26 @@ Public Class Scheduler
|
||||
_Logger.Debug("Job details: {0}", oCronDetails.Rows.Count)
|
||||
_Logger.Debug("Job definition: {0}", oDefinition)
|
||||
|
||||
For Each oRowDetail In oCronDetails.Rows
|
||||
For Each oRowDetail As DataRow In oCronDetails.Rows
|
||||
Dim oTrigger As ITrigger
|
||||
Dim oJob As IJobDetail
|
||||
Dim oDataTableName As String = oRowDetail.Item("DT_NAME")
|
||||
Dim oRunOnStartup As Boolean = oRowDetail.Item("RUN_ON_STARTUP")
|
||||
Dim oJobIdentity As String = $"{oGuid}~{oDataTableName}"
|
||||
|
||||
oTrigger = TriggerBuilder.Create().
|
||||
WithIdentity(oTitle).
|
||||
WithCronSchedule(oDefinition).
|
||||
StartNow().
|
||||
Build()
|
||||
Dim oBaseTrigger = TriggerBuilder.Create().
|
||||
WithIdentity(oJobIdentity, JOB_GROUP).
|
||||
WithCronSchedule(oDefinition)
|
||||
|
||||
' Run directly at startup if configured
|
||||
If oRunOnStartup Then
|
||||
oBaseTrigger = oBaseTrigger.StartNow()
|
||||
End If
|
||||
|
||||
oTrigger = oBaseTrigger.Build()
|
||||
|
||||
oJob = JobBuilder.Create(Of DatatableJob)().
|
||||
WithIdentity(oGuid, JOB_GROUP).
|
||||
WithIdentity(oJobIdentity, JOB_GROUP).
|
||||
UsingJobData(New JobDataMap() From {
|
||||
{"LogConfig", _LogConfig},
|
||||
{"MSSQL", _MSSQL},
|
||||
|
||||
Reference in New Issue
Block a user