First version of service
This commit is contained in:
@@ -6,6 +6,7 @@ Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Messaging
|
||||
Imports DigitalData.Modules.Config
|
||||
Imports GdPicture.Internal.WPF
|
||||
|
||||
Public Class Service
|
||||
Private Logger As Logger
|
||||
@@ -37,19 +38,27 @@ Public Class Service
|
||||
|
||||
Logger.Info("Inititalize Databases")
|
||||
|
||||
If Config.ConnectionString <> String.Empty Then
|
||||
Database = New MSSQLServer(LogConfig, Config.ConnectionString)
|
||||
If Config.ConnectionString = String.Empty Then
|
||||
Throw New ApplicationException("Connection String is empty!")
|
||||
End If
|
||||
|
||||
If Database.DBInitialized = False Then
|
||||
Logger.Warn("MSSQL Connection could not be established. Check the Error Log")
|
||||
End If
|
||||
Database = New MSSQLServer(LogConfig, Config.ConnectionString)
|
||||
|
||||
If Database.DBInitialized = False Then
|
||||
Throw New ApplicationException("Database connection could not be established!")
|
||||
End If
|
||||
|
||||
Dim oKey = Database.GetScalarValue("SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE NAME = 'GDPICTURE'")
|
||||
|
||||
If String.IsNullOrWhiteSpace(oKey) Then
|
||||
Throw New ApplicationException("GDPicture License could not be loaded!")
|
||||
End If
|
||||
|
||||
' === Initialize Queue ===
|
||||
|
||||
Logger.Debug("Inititalize Quartz")
|
||||
|
||||
Scheduler = New Scheduler(LogConfig, Config.ConnectionString)
|
||||
Scheduler = New Scheduler(LogConfig, Config.ConnectionString, oKey)
|
||||
Await Scheduler.Start(Config.IntervalInMin)
|
||||
|
||||
Logger.Info("Started [{0}] !", ServiceName)
|
||||
|
||||
Reference in New Issue
Block a user