update jobrunner
This commit is contained in:
@@ -90,55 +90,8 @@ Public Class JobRunner
|
||||
Await _scheduler.Shutdown()
|
||||
End Sub
|
||||
|
||||
Public Class ADJob
|
||||
Implements Quartz.IJob
|
||||
|
||||
Public Function Execute(context As IJobExecutionContext) As Task Implements Quartz.IJob.Execute
|
||||
Dim oJobData = context.MergedJobDataMap
|
||||
Dim oLogConfig As LogConfig = oJobData.Item("LogConfig")
|
||||
Dim oFirebird As Firebird = oJobData.Item("Firebird")
|
||||
Dim oMSSQL As MSSQLServer = oJobData.Item("MSSQL")
|
||||
Dim oArgs As Dictionary(Of String, String) = oJobData.Item("Args")
|
||||
Dim oADJobArgs = New ADSyncArgs()
|
||||
|
||||
If oArgs.ContainsKey("RootPath") Then
|
||||
oADJobArgs.RootPath = oArgs.Item("RootPath")
|
||||
End If
|
||||
|
||||
If oArgs.ContainsKey("DisableFirebird") AndAlso oArgs.Item("DisableFirebird") = "True" Then
|
||||
oFirebird = Nothing
|
||||
End If
|
||||
|
||||
If oArgs.ContainsKey("DisableMSSQL") AndAlso oArgs.Item("DisableMSSQL") = "True" Then
|
||||
oMSSQL = Nothing
|
||||
End If
|
||||
|
||||
Dim oADSyncJob As New ADSyncJob(oLogConfig, oFirebird, oMSSQL)
|
||||
oADSyncJob.Start(oADJobArgs)
|
||||
|
||||
Return Task.FromResult(True)
|
||||
End Function
|
||||
End Class
|
||||
Public Class TestJob
|
||||
Implements Quartz.IJob
|
||||
|
||||
Public Function Execute(context As IJobExecutionContext) As Task Implements Quartz.IJob.Execute
|
||||
Dim oJobData = context.MergedJobDataMap
|
||||
Dim oLogConfig As LogConfig = oJobData.Item("LogConfig")
|
||||
Dim oLogger = oLogConfig.GetLogger()
|
||||
|
||||
Dim oArgs As Dictionary(Of String, String) = oJobData.Item("Args")
|
||||
|
||||
If oArgs.ContainsKey("Arg1") Then
|
||||
Dim oArg1 As String = oArgs.Item("Arg1")
|
||||
oLogger.Info("Running Test Job With Arg1: {0}", oArg1)
|
||||
Else
|
||||
oLogger.Warn("Running Test Job With missing Arg1 :/")
|
||||
End If
|
||||
|
||||
Return Task.FromResult(True)
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Private Class LogProvider
|
||||
Implements ILogProvider
|
||||
|
||||
Reference in New Issue
Block a user