16-12-2022
This commit is contained in:
@@ -16,6 +16,8 @@ Namespace WCF
|
||||
Public Shared Database As MSSQLServer
|
||||
Public Shared Scheduler As JobScheduler
|
||||
|
||||
Private ReadOnly Logger As Logger
|
||||
|
||||
''' <summary>
|
||||
''' See: https://stackoverflow.com/questions/42327988/addserviceendpoint-throws-key-is-null
|
||||
''' </summary>
|
||||
@@ -33,33 +35,41 @@ Namespace WCF
|
||||
})
|
||||
End Sub
|
||||
|
||||
Public Sub New()
|
||||
Logger = LogConfig.GetLogger()
|
||||
End Sub
|
||||
|
||||
Public Function GetHeartbeat() As Date Implements IJobRunner.GetHeartbeat
|
||||
Return Now
|
||||
End Function
|
||||
|
||||
Public Function GetJobHistory() As GetJobStatus.GetJobStatusResponse Implements IJobRunner.GetJobStatus
|
||||
Logger.Info("Calling Method [GetJobHistory]")
|
||||
Dim oMethod As New GetJobStatus.GetJobStatusMethod(LogConfig, Database, State, Scheduler)
|
||||
Return oMethod.Run()
|
||||
End Function
|
||||
|
||||
Public Function GetJobConfig() As GetJobConfig.GetJobConfigResponse Implements IJobRunner.GetJobConfig
|
||||
Logger.Info("Calling Method [GetJobConfig]")
|
||||
Dim oMethod As New GetJobConfig.GetJobConfigMethod(LogConfig, Database, State)
|
||||
Return oMethod.Run()
|
||||
End Function
|
||||
|
||||
Public Function UpdateJob(pData As UpdateJob.UpdateJobRequest) As UpdateJob.UpdateJobResponse Implements IJobRunner.UpdateJob
|
||||
Logger.Info("Calling Method [UpdateJob]")
|
||||
Dim oMethod As New UpdateJob.UpdateJobMethod(LogConfig, Database, State, Scheduler)
|
||||
Return oMethod.Run(pData)
|
||||
End Function
|
||||
|
||||
Public Function UpdateProfile(pData As UpdateProfile.UpdateProfileRequest) As UpdateProfile.UpdateProfileResponse Implements IJobRunner.UpdateProfile
|
||||
Logger.Info("Calling Method [UpdateProfile]")
|
||||
Dim oMethod As New UpdateProfile.UpdateProfileMethod(LogConfig, Database, State, Scheduler)
|
||||
Return oMethod.Run(pData)
|
||||
End Function
|
||||
|
||||
Public Function RunJob(pData As RunJob.RunJobRequest) As RunJob.RunJobResponse Implements IJobRunner.RunJob
|
||||
'Dim oMethod As New RunJob.RunJobMethod(LogConfig, Database, State, Scheduler)
|
||||
'Return oMethod.Run(pData)
|
||||
Dim oMethod As New RunJob.RunJobMethod(LogConfig, Database, State, Scheduler)
|
||||
Return oMethod.Run(pData)
|
||||
End Function
|
||||
End Class
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ Public Class RunJob
|
||||
Scheduler = pScheduler
|
||||
End Sub
|
||||
|
||||
Public Async Function Run(pData As RunJobRequest) As Task(Of RunJobResponse)
|
||||
Public Function Run(pData As RunJobRequest) As RunJobResponse
|
||||
' This is calling the async function ScheduleJob synchronous, so that we can return a value to the caller
|
||||
' This means that the job might or might not be scheduled when this method returns.
|
||||
Task.Run(Function() Scheduler.ScheduleJob(pData.JobId))
|
||||
Scheduler.ScheduleJob(pData.JobId)
|
||||
|
||||
Return New RunJobResponse()
|
||||
End Function
|
||||
|
||||
Reference in New Issue
Block a user