This commit is contained in:
SchreiberM 2022-12-16 11:54:37 +01:00
parent 673aa6bf95
commit eed9848f43

View File

@ -42,10 +42,12 @@ Public Class EmailService
_LogConfig.Debug = _Config.Debug
Dim oCurrentDomain As AppDomain = AppDomain.CurrentDomain
AddHandler oCurrentDomain.UnhandledException, AddressOf AppDomain_UnhandledException
_Logger = _LogConfig.GetLogger()
_Logger.Info($"DEBUG = {_LogConfig.Debug}")
_Logger.Info("Starting {0}", ServiceName)
@ -92,11 +94,9 @@ Public Class EmailService
_limilab = New Limilab(_LogConfig)
_MailSender = New MailSender(_LogConfig)
_Logger.EndBlock()
' === Initialize Queue ===
_Logger.NewBlock("Inititalize Queue")
_Logger.Debug("Inititalize Queue")
If _AnyDatabaseInitialized Then
_EmailQueue = New BackgroundWorker() With {
@ -108,11 +108,9 @@ Public Class EmailService
AddHandler _EmailQueue.RunWorkerCompleted, AddressOf EmailQueue_Completed
End If
_Logger.EndBlock()
' === Initialize & Start Timer ===
_Logger.NewBlock("Initialize & Start Timer")
_Logger.Debug("Initialize & Start Timer")
If _AnyDatabaseInitialized Then
_QueueTimer = New Timer With {
@ -123,8 +121,6 @@ Public Class EmailService
AddHandler _QueueTimer.Elapsed, AddressOf QueueTimer_Elapsed
End If
_Logger.EndBlock()
' === Initial Run ===
If _AnyDatabaseInitialized Then
@ -476,7 +472,7 @@ Public Class EmailService
End If
MSSQLInstance.ExecuteNonQuery(oSQL)
End Select
_Logger.Info($"EmailID [{oGuid.ToString}] has been send to: {oEmailTo} - althogh there was an error in connection close!")
_Logger.Info($"EmailID [{oGuid.ToString}] has been send to: {oEmailTo} - although there was an error in connection close!")
End If