Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Jobs
Imports DigitalData.Modules.Logging
Imports Quartz

Public Class GraphQLJob
    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 oMSSQL As MSSQLServer = oJobData.Item("MSSQL")
        Dim oArgs As Dictionary(Of String, String) = oJobData.Item("Args")
        Dim oJobArgs = New GraphQLArgs With {
            .QueryConfigPath = oArgs.Item("QueryConfigFolder")
        }

        Dim oGraphQLJob As New Modules.Jobs.GraphQLJob(oLogConfig, oMSSQL)
        oGraphQLJob.Start(oJobArgs)

        Return Task.FromResult(True)
    End Function
End Class