From 03938a20bcb85b29b2769a94872f619214d47e04 Mon Sep 17 00:00:00 2001 From: StanR Date: Mon, 1 Jul 2024 12:22:28 +0500 Subject: [PATCH] Update packages, use sliding invisibility timeout --- .../Mutualify/Jobs/UserRelationsUpdateJob.cs | 4 ++-- backend/Mutualify/Jobs/UserUpdateJob.cs | 4 ++-- backend/Mutualify/Mutualify.csproj | 22 +++++++++---------- backend/Mutualify/Program.cs | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/backend/Mutualify/Jobs/UserRelationsUpdateJob.cs b/backend/Mutualify/Jobs/UserRelationsUpdateJob.cs index 550bfab..4f25a93 100644 --- a/backend/Mutualify/Jobs/UserRelationsUpdateJob.cs +++ b/backend/Mutualify/Jobs/UserRelationsUpdateJob.cs @@ -30,11 +30,11 @@ public async Task Run(PerformContext context, CancellationToken token) { var jobId = context.BackgroundJob.Id; - using var _ = _logger.BeginScope("[UserRelationsUpdateJob - {JobId}]", jobId); + using var _ = _logger.BeginScope("UserRelationsUpdateJob"); _logger.LogInformation("[{JobId}] Starting user relations update job...", jobId); - if (_isRunning && _lastStartDate.AddDays(1.5) > DateTime.Now) + if (_isRunning && _lastStartDate.AddDays(1) > DateTime.Now) { _logger.LogInformation("[{JobId}] User relations job is already running, abort!", jobId); return; diff --git a/backend/Mutualify/Jobs/UserUpdateJob.cs b/backend/Mutualify/Jobs/UserUpdateJob.cs index 474414b..a2ddfd6 100644 --- a/backend/Mutualify/Jobs/UserUpdateJob.cs +++ b/backend/Mutualify/Jobs/UserUpdateJob.cs @@ -29,11 +29,11 @@ public async Task Run(PerformContext context, CancellationToken token) { var jobId = context.BackgroundJob.Id; - using var _ = _logger.BeginScope("[UserUpdateJob - {JobId}]", jobId); + using var _ = _logger.BeginScope("UserUpdateJob"); _logger.LogInformation("[{JobId}] Starting user update job...", jobId); - if (_isRunning && _lastStartDate.AddDays(1.5) > DateTime.Now) + if (_isRunning && _lastStartDate.AddDays(1) > DateTime.Now) { _logger.LogInformation("[{JobId}] Job is already running, abort!", jobId); return; diff --git a/backend/Mutualify/Mutualify.csproj b/backend/Mutualify/Mutualify.csproj index 8ba65c1..fba56c6 100644 --- a/backend/Mutualify/Mutualify.csproj +++ b/backend/Mutualify/Mutualify.csproj @@ -9,24 +9,24 @@ - - + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + - - - - - + + + + + diff --git a/backend/Mutualify/Program.cs b/backend/Mutualify/Program.cs index d122d12..bc6e18a 100644 --- a/backend/Mutualify/Program.cs +++ b/backend/Mutualify/Program.cs @@ -147,7 +147,7 @@ static Task UnauthorizedRedirect(RedirectContext co .UsePostgreSqlStorage(options => { options.UseConnectionFactory(new NpgsqlConnectionFactory(connectionString.ConnectionString, - new PostgreSqlStorageOptions { InvisibilityTimeout = TimeSpan.FromDays(1) })); + new PostgreSqlStorageOptions { UseSlidingInvisibilityTimeout = true })); }); });