4 Commits

Author SHA1 Message Date
Jonathan Jenne
80b62ac081 Version 2.0.0.1 2022-11-25 10:35:25 +01:00
Jonathan Jenne
a1579225af ZUGFeRDService: remove manual cleaning up of log files 2022-11-25 10:34:57 +01:00
Jonathan Jenne
5f6069f4a9 JobRunner: Improve logging 2022-11-25 10:34:37 +01:00
Jonathan Jenne
20b244c074 JobRunner: Remove My.Settings entries 2022-11-25 10:34:24 +01:00
6 changed files with 18 additions and 187 deletions

View File

@@ -1,44 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="DigitalData.Services.JobRunner.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<DigitalData.Services.JobRunner.My.MySettings>
<setting name="LOG_PATH" serializeAs="String">
<value />
</setting>
<setting name="SQL_CONNECTIONSTRING" serializeAs="String">
<value />
</setting>
<setting name="FIREBIRD_SERVER" serializeAs="String">
<value />
</setting>
<setting name="FIREBIRD_DATABASE" serializeAs="String">
<value />
</setting>
<setting name="FIREBIRD_USER" serializeAs="String">
<value />
</setting>
<setting name="FIREBIRD_PASSWORD" serializeAs="String">
<value />
</setting>
<setting name="LOG_DEBUG" serializeAs="String">
<value>False</value>
</setting>
<setting name="ADSYNC_CONFIG" serializeAs="String">
<value>False|0 0 0/1 * * ?|RootPath::LDAP://DIGITALDATA,UserFilter::(&amp;(samaccountname=@SAMACCOUNTNAME)),GroupFilter::(&amp;(samaccountname=*))</value>
</setting>
<setting name="TEST_CONFIG" serializeAs="String">
<value>False|10/0 * * * * ?|Foo::Bar</value>
</setting>
<setting name="GRAPHQL_CONFIG" serializeAs="String">
<value>False|0 0 0/1 * * ?|QueryConfigFolder::E:\JenneJ\GraphQL</value>
</setting>
</DigitalData.Services.JobRunner.My.MySettings>
</applicationSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>

View File

@@ -13,21 +13,24 @@ Public Class JobRunnerService
Private _jobrunner As JobRunner
Protected Overrides Sub OnStart(ByVal args() As String)
_logConfig = New LogConfig(PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log"))
_logConfig = New LogConfig(PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log")) With {.Debug = True}
_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
_logger.Info("Starting Service {0}", ServiceName)
_config = New ConfigManager(Of Config)(_logConfig, My.Application.Info.DirectoryPath)
_logConfig.Debug = _config.Config.Debug
Dim oFirebird = _config.Config.Firebird
_logger.Debug("Connecting to Database..")
_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
_logger.Debug("Starting Jobrunner..")
_jobrunner = New JobRunner(_logConfig, _config.Config, _mssql, _firebird)
_jobrunner.Start()
Catch ex As Exception

View File

@@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("Service.JobRunner")>
<Assembly: AssemblyCopyright("Copyright © 2022")>
<Assembly: AssemblyTrademark("2.0.0.0")>
<Assembly: AssemblyTrademark("2.0.0.1")>
<Assembly: ComVisible(False)>
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>
<Assembly: AssemblyVersion("2.0.0.1")>
<Assembly: AssemblyFileVersion("1.0.0.1")>

View File

@@ -15,7 +15,7 @@ Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0"), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
@@ -53,97 +53,6 @@ Namespace My
Return defaultInstance
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("")> _
Public ReadOnly Property LOG_PATH() As String
Get
Return CType(Me("LOG_PATH"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("")> _
Public ReadOnly Property SQL_CONNECTIONSTRING() As String
Get
Return CType(Me("SQL_CONNECTIONSTRING"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("")> _
Public ReadOnly Property FIREBIRD_SERVER() As String
Get
Return CType(Me("FIREBIRD_SERVER"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("")> _
Public ReadOnly Property FIREBIRD_DATABASE() As String
Get
Return CType(Me("FIREBIRD_DATABASE"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("")> _
Public ReadOnly Property FIREBIRD_USER() As String
Get
Return CType(Me("FIREBIRD_USER"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("")> _
Public ReadOnly Property FIREBIRD_PASSWORD() As String
Get
Return CType(Me("FIREBIRD_PASSWORD"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("False")> _
Public ReadOnly Property LOG_DEBUG() As Boolean
Get
Return CType(Me("LOG_DEBUG"),Boolean)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("True|10/0 * * * * ?|Foo::Bar")> _
Public ReadOnly Property TEST_CONFIG() As String
Get
Return CType(Me("TEST_CONFIG"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("False|0 0 0/1 * * ?|QueryConfigFolder::E:\JenneJ\GraphQL")> _
Public ReadOnly Property GRAPHQL_CONFIG() As String
Get
Return CType(Me("GRAPHQL_CONFIG"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("False|0 0 0/1 * * ?|RootPath::LDAP://DIGITALDATA,UserFilter::(&(samaccountname=@S"& _
"AMACCOUNTNAME)),GroupFilter::(&(samaccountname=*))")> _
Public ReadOnly Property ADSYNC_CONFIG() As String
Get
Return CType(Me("ADSYNC_CONFIG"),String)
End Get
End Property
End Class
End Namespace

View File

@@ -1,36 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="My" GeneratedClassName="MySettings" UseMySettingsClassName="true">
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles />
<Settings>
<Setting Name="LOG_PATH" Type="System.String" Scope="Application">
<Value Profile="(Default)" />
</Setting>
<Setting Name="SQL_CONNECTIONSTRING" Type="System.String" Scope="Application">
<Value Profile="(Default)" />
</Setting>
<Setting Name="FIREBIRD_SERVER" Type="System.String" Scope="Application">
<Value Profile="(Default)" />
</Setting>
<Setting Name="FIREBIRD_DATABASE" Type="System.String" Scope="Application">
<Value Profile="(Default)" />
</Setting>
<Setting Name="FIREBIRD_USER" Type="System.String" Scope="Application">
<Value Profile="(Default)" />
</Setting>
<Setting Name="FIREBIRD_PASSWORD" Type="System.String" Scope="Application">
<Value Profile="(Default)" />
</Setting>
<Setting Name="LOG_DEBUG" Type="System.Boolean" Scope="Application">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="ADSYNC_CONFIG" Type="System.String" Scope="Application">
<Value Profile="(Default)">False|0 0 0/1 * * ?|RootPath::LDAP://DIGITALDATA,UserFilter::(&amp;(samaccountname=@SAMACCOUNTNAME)),GroupFilter(&amp;(samaccountname=*))</Value>
</Setting>
<Setting Name="TEST_CONFIG" Type="System.String" Scope="Application">
<Value Profile="(Default)">True|10/0 * * * * ?|Foo::Bar</Value>
</Setting>
<Setting Name="GRAPHQL_CONFIG" Type="System.String" Scope="Application">
<Value Profile="(Default)">False|0 0 0/1 * * ?|QueryConfigFolder::E:\JenneJ\GraphQL</Value>
</Setting>
</Settings>
<Settings />
</SettingsFile>

View File

@@ -18,19 +18,6 @@ Public Class ZUGFeRDService
_config = New ConfigManager(Of Config)(_logConfig, My.Application.Info.DirectoryPath)
_logConfig.Debug = _config.Config.Debug
_logger = _logConfig.GetLogger()
Try
Dim directory As New IO.DirectoryInfo(_logConfig.LogDirectory)
For Each file As IO.FileInfo In directory.GetFiles
If (Now - file.CreationTime).Days > 29 Then
file.Delete()
Else
Exit For
End If
Next
Catch ex As Exception
End Try
_logger.Info($"{Constants.SERVICE_NAME} is starting.")
Dim oDataSource As String = _config.Config.Firebird.DataSource