check การ reprocess ถ้า task นั้นไม่ได้ pedning แล้วให้ข้ามงานนั้นไป
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m52s

This commit is contained in:
Suphonchai Phoonsawat 2026-07-20 12:31:03 +07:00
parent bea7960ea7
commit 122f02ac97

View file

@ -30,6 +30,7 @@ using RabbitMQ.Client.Events;
using Swashbuckle.AspNetCore.Annotations; using Swashbuckle.AspNetCore.Annotations;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Diagnostics; using System.Diagnostics;
using System.Reflection.Metadata.Ecma335;
using System.Security.Claims; using System.Security.Claims;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -779,6 +780,16 @@ namespace BMA.EHR.Leave.Service.Controllers
{ {
try try
{ {
// var get current status
var task = await _checkInJobStatusRepository.GetByTaskIdAsync(job.TaskId);
// return if stask status != "PENDING"
if (task is not null)
{
if (task.Status != "PENDING")
continue;
}
// อ่านข้อมูลเดิมจาก AdditionalData // อ่านข้อมูลเดิมจาก AdditionalData
if (string.IsNullOrEmpty(job.AdditionalData)) if (string.IsNullOrEmpty(job.AdditionalData))
{ {
@ -1075,6 +1086,9 @@ namespace BMA.EHR.Leave.Service.Controllers
try try
{ {
// อัปเดตสถานะเป็น PROCESSING // อัปเดตสถานะเป็น PROCESSING
if (taskId != Guid.Empty) if (taskId != Guid.Empty)
{ {