File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
src/TaskManager/Plug-ins/AideClinicalReview Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 1414 * limitations under the License.
1515 */
1616
17- using Ardalis . GuardClauses ;
1817using Microsoft . Extensions . DependencyInjection ;
1918using Microsoft . Extensions . Logging ;
2019using Microsoft . Extensions . Options ;
@@ -321,6 +320,26 @@ public async ValueTask DisposeAsync()
321320 GC . SuppressFinalize ( this ) ;
322321 }
323322
324- public override Task HandleTimeout ( string identity ) => Task . CompletedTask ; // not implemented
323+ public override Task HandleTimeout ( string identity )
324+ {
325+ var message = GenerateCancelationMessage ( identity ) ;
326+
327+ var queue = _queueName ?? _options . Value . Messaging . Topics . AideClinicalReviewCancelation ;
328+ _logger . SendClinicalReviewRequestMessage ( queue , _workflowName ?? string . Empty ) ;
329+ return _messageBrokerPublisherService . Publish ( queue , message . ToMessage ( ) ) ;
330+ }
331+
332+ private JsonMessage < TaskCancellationEvent > GenerateCancelationMessage ( string identity )
333+ {
334+ return new JsonMessage < TaskCancellationEvent > ( new TaskCancellationEvent
335+ {
336+ ExecutionId = identity ,
337+ WorkflowInstanceId = Event . WorkflowInstanceId ,
338+ TaskId = Event . TaskId ,
339+ Reason = FailureReason . TimedOut ,
340+ Identity = identity ,
341+ Message = $ "{ FailureReason . TimedOut } { DateTime . UtcNow } "
342+ } , TaskManagerApplicationId , Event . CorrelationId ) ;
343+ }
325344 }
326345}
You can’t perform that action at this time.
0 commit comments