JobRunner: Update to use tables
This commit is contained in:
@@ -1,31 +1,34 @@
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports System.IO
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Logging.LogConfig
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Services.JobRunner
|
||||
Imports DigitalData.Modules.Config
|
||||
|
||||
Public Class JobRunnerService
|
||||
Private _logConfig As LogConfig
|
||||
Private _logger As Logger
|
||||
Private _config As ConfigManager(Of Config)
|
||||
Private _mssql As MSSQLServer
|
||||
Private _firebird As Firebird
|
||||
Private _jobrunner As JobRunner
|
||||
|
||||
Protected Overrides Sub OnStart(ByVal args() As String)
|
||||
_logConfig = New LogConfig(PathType.CustomPath, My.Settings.LOG_PATH) With {
|
||||
.Debug = My.Settings.LOG_DEBUG
|
||||
}
|
||||
_logConfig = New LogConfig(PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log"))
|
||||
_logger = _logConfig.GetLogger()
|
||||
_logger.Info("Starting Service {0}", ServiceName)
|
||||
_config = New ConfigManager(Of Config)(_logConfig, My.Application.Info.DirectoryPath)
|
||||
|
||||
Dim oFirebird = _config.Config.Firebird
|
||||
|
||||
Try
|
||||
_mssql = New MSSQLServer(_logConfig, My.Settings.SQL_CONNECTIONSTRING)
|
||||
_firebird = New Firebird(_logConfig, My.Settings.FIREBIRD_SERVER, My.Settings.FIREBIRD_DATABASE, My.Settings.FIREBIRD_USER, My.Settings.FIREBIRD_PASSWORD)
|
||||
_mssql = New MSSQLServer(_logConfig, _config.Config.SQLConnectionString)
|
||||
_firebird = New Firebird(_logConfig, oFirebird.DataSource, oFirebird.Database, oFirebird.User, oFirebird.Password)
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
End Try
|
||||
|
||||
Try
|
||||
_jobrunner = New JobRunner(_logConfig, _mssql, _firebird)
|
||||
_jobrunner = New JobRunner(_logConfig, _config.Config, _mssql, _firebird)
|
||||
_jobrunner.Start()
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
|
||||
Reference in New Issue
Block a user