diff --git a/src/TRE-API/DoAgentWork.cs b/src/TRE-API/DoAgentWork.cs index fd280386a..3e418eeac 100644 --- a/src/TRE-API/DoAgentWork.cs +++ b/src/TRE-API/DoAgentWork.cs @@ -372,17 +372,39 @@ public async Task CheckTESK(string taskID, int subId, string tesId, string outpu break; } - - var result = _subHelper.UpdateStatusForTre(subId.ToString(), statusMessage, ""); + APIReturn? result = null; + try + { + result = _subHelper.UpdateStatusForTre(subId.ToString(), statusMessage, ""); + } + catch (Exception ex) + { + Log.Error(ex.ToString()); + } + if (status.state == "COMPLETE") { Log.Information($" CloseSubmissionForTre with status.state subId {subId.ToString()} == COMPLETE "); - result = _subHelper.CloseSubmissionForTre(subId.ToString(), StatusType.Completed, "",""); + try + { + result = _subHelper.CloseSubmissionForTre(subId.ToString(), StatusType.Completed, "",""); + } + catch (Exception ex) + { + Log.Error(ex.ToString()); + } } else if (status.state == "EXECUTER_ERROR" || status.state == "SYSTEM_ERROR") { Log.Information($" CloseSubmissionForTre with status.state subId {subId.ToString()} == EXECUTER_ERROR or SYSTEM_ERROR "); - result = _subHelper.CloseSubmissionForTre(subId.ToString(), StatusType.Failed, "", ""); + try + { + result = _subHelper.CloseSubmissionForTre(subId.ToString(), StatusType.Failed, "", ""); + } + catch (Exception ex) + { + Log.Error(ex.ToString()); + } } } Log.Information($" Checking status "); @@ -600,7 +622,7 @@ public void Execute() - var OutputBucket = _AgentSettings.TESKOutputBucketPrefix + _dbContext.Projects.First(x => x.Id == projectId).OutputBucketTre; //TODO Check, Projects not getting The synchronised Properly + var OutputBucket = _AgentSettings.TESKOutputBucketPrefix + _dbContext.Projects.First(x => x.SubmissionProjectId == projectId).OutputBucketTre; //TODO Check, Projects not getting The synchronised Properly //it need the file name?? (key-name) if (tesMessage.Outputs == null) diff --git a/src/TRE-UI/Views/Approval/EditProject.cshtml b/src/TRE-UI/Views/Approval/EditProject.cshtml index 6244a0948..bab69536e 100644 --- a/src/TRE-UI/Views/Approval/EditProject.cshtml +++ b/src/TRE-UI/Views/Approval/EditProject.cshtml @@ -32,11 +32,11 @@