From 476a7c782d8f36cc8b7444b5a104cce38d059041 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 20 Dec 2023 15:01:11 +0100 Subject: [PATCH] Add option to check file age --- Services.ZUGFeRDService/Config.vb | 7 +++++++ Services.ZUGFeRDService/ThreadRunner.vb | 2 ++ 2 files changed, 9 insertions(+) diff --git a/Services.ZUGFeRDService/Config.vb b/Services.ZUGFeRDService/Config.vb index e1ca2785..bd0a7b4b 100644 --- a/Services.ZUGFeRDService/Config.vb +++ b/Services.ZUGFeRDService/Config.vb @@ -37,6 +37,13 @@ ''' Public Property MaxAttachmentSizeInMegaBytes As Integer = -1 + ''' + ''' Minimum file age. If one file is newer than this, the whole group will be skipped + ''' to ensure that all files of a group have been created. + ''' + ''' + Public Property MinFileAgeInMinutes As Integer = 5 + Public Property AllowFacturX As Boolean = False Public Property AllowXRechnung As Boolean = False Public Property AllowZugferd10 As Boolean = True diff --git a/Services.ZUGFeRDService/ThreadRunner.vb b/Services.ZUGFeRDService/ThreadRunner.vb index 6493b08f..9662eef3 100644 --- a/Services.ZUGFeRDService/ThreadRunner.vb +++ b/Services.ZUGFeRDService/ThreadRunner.vb @@ -45,6 +45,7 @@ Public Class ThreadRunner .ExceptionEmailAddress = _config.Config.ExceptionEmailAddress, .IgnoreRejectionStatus = _config.Config.Custom.IgnoreRejectionStatus, .MaxAttachmentSizeInMegaBytes = _config.Config.Custom.MaxAttachmentSizeInMegaBytes, + .MinFileAgeInMinutes = _config.Config.Custom.MinFileAgeInMinutes, .NamePortal = _config.Config.PORTAL_NAME, .EmailOutProfileId = _config.Config.MSSQLEmailOutAccountID, .AllowFacturX = _config.Config.Custom.AllowFacturX, @@ -60,6 +61,7 @@ Public Class ThreadRunner _logger.Debug("ExceptionEmailAddress: [{0}]", oArgs.ExceptionEmailAddress) _logger.Debug("IgnoreRejectionStatus: [{0}]", oArgs.IgnoreRejectionStatus) _logger.Debug("MaxAttachmentSizeInMegaBytes: [{0}]", oArgs.MaxAttachmentSizeInMegaBytes) + _logger.Debug("MinFileAgeInMinutes: [{0}]", oArgs.MinFileAgeInMinutes) _jobArguments = oArgs