From b1c3d90b40a0ced3a948832c76491c585e1fa452 Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Mon, 13 Jul 2026 16:16:37 +1000 Subject: [PATCH] =?UTF-8?q?fix(dal,snapshotsWorker):=20=D0=98=D1=81=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=20=D0=B7=D0=B0=D1=85=D0=B2?= =?UTF-8?q?=D0=B0=D1=82=20=D1=80=D0=BE=D0=B1=D0=BE=D1=82=D0=BE=D0=BC=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=B4=D0=B0=D1=87=D0=B8,=20=D0=B4=D0=BE=D0=B1?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE=20=D1=83=D0=B2=D0=B5=D0=BB?= =?UTF-8?q?=D0=B8=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=BF=D1=8B?= =?UTF-8?q?=D1=82=D0=BE=D0=BA.=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=20dockerfile=20=D0=B4=D0=BB=D1=8F=20=D1=81?= =?UTF-8?q?=D0=BD=D0=B0=D0=BF=D1=88=D0=BE=D1=82=D0=BE=D0=B2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PARR.DAL/Repositories/RobotConfigurationRepository.cs | 5 +++-- PARR.SnapshotWorker/Dockerfile | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/PARR.DAL/Repositories/RobotConfigurationRepository.cs b/PARR.DAL/Repositories/RobotConfigurationRepository.cs index ad3c63f6..efbb22be 100644 --- a/PARR.DAL/Repositories/RobotConfigurationRepository.cs +++ b/PARR.DAL/Repositories/RobotConfigurationRepository.cs @@ -116,12 +116,12 @@ namespace PARR.DAL.Repositories var endDate = DateTimeOffset.UtcNow.Add(-settingsFromDb.RobotWaitTime); // Выполняем атомарный UPDATE напрямую в базе данных - var affectedRows = await EntitySet.Where(t => t.Id == id + var affectedRows = await EntitySet.Where(t => t.Id == id && ( // Задания в статусе ожидание t.RobotStatusCode == (int)RobotStatusEnum.Wait || ( - // Задание в статусе в работе, но они зависли + // Задание в статусе в работе, но они зависли t.RobotStatusCode == (int)RobotStatusEnum.InProgress && t.AttemptsNumber < settingsFromDb.RobotAttemptsNumber && t.LastRobotStatusUpdated < endDate @@ -131,6 +131,7 @@ namespace PARR.DAL.Repositories .ExecuteUpdateAsync(s => s .SetProperty(t => t.RobotStatusCode, (int)RobotStatusEnum.InProgress) .SetProperty(t => t.LastRobotStatusUpdated, DateTimeOffset.UtcNow) + .SetProperty(t => t.AttemptsNumber, t => t.AttemptsNumber + 1) ); return affectedRows > 0; diff --git a/PARR.SnapshotWorker/Dockerfile b/PARR.SnapshotWorker/Dockerfile index 1dba85b6..65553c01 100644 --- a/PARR.SnapshotWorker/Dockerfile +++ b/PARR.SnapshotWorker/Dockerfile @@ -2,13 +2,13 @@ # This stage is used when running from VS in fast mode (Default for Debug configuration) FROM 10.99.253.167:8090/dotnet/runtime:9.0 AS base -#USER $APP_UID WORKDIR /app # This stage is used to build the service project FROM 10.99.253.167:8090/dotnet/sdk:9.0 AS build ARG BUILD_CONFIGURATION=Release +USER root WORKDIR /src COPY ["NuGet.config", "."] COPY ["PARR.SnapshotWorker/PARR.SnapshotWorker.csproj", "PARR.SnapshotWorker/"]