diff --git a/Conductor/Client/Worker/WorkflowTaskExecutor.cs b/Conductor/Client/Worker/WorkflowTaskExecutor.cs index 180a4c35..fc877195 100644 --- a/Conductor/Client/Worker/WorkflowTaskExecutor.cs +++ b/Conductor/Client/Worker/WorkflowTaskExecutor.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright 2024 Conductor Authors. *

* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with @@ -93,7 +93,7 @@ private void Work4Ever(CancellationToken token) if (token != CancellationToken.None) token.ThrowIfCancellationRequested(); - WorkOnce(token); + WorkOnce(token).GetAwaiter().GetResult(); } catch (System.OperationCanceledException canceledException) { @@ -120,7 +120,7 @@ private void Work4Ever(CancellationToken token) } } - private async void WorkOnce(CancellationToken token) + private async System.Threading.Tasks.Task WorkOnce(CancellationToken token) { if (token != CancellationToken.None) token.ThrowIfCancellationRequested(); @@ -201,7 +201,7 @@ private async void WorkOnce(CancellationToken token) } } - private async void ProcessTasks(List tasks, CancellationToken token) + private async System.Threading.Tasks.Task ProcessTasks(List tasks, CancellationToken token) { List threads = new List(); if (tasks == null || tasks.Count == 0) @@ -221,7 +221,7 @@ private async void ProcessTasks(List tasks, CancellationToken token await System.Threading.Tasks.Task.WhenAll(threads); } - private async void ProcessTask(Models.Task task, CancellationToken token) + private async System.Threading.Tasks.Task ProcessTask(Models.Task task, CancellationToken token) { if (token != CancellationToken.None) token.ThrowIfCancellationRequested(); @@ -341,7 +341,7 @@ private void RecordTaskResultSize(Models.TaskResult taskResult) private void Sleep(TimeSpan timeSpan) { - _logger.LogDebug($"[{_workerSettings.WorkerId}] Sleeping for {timeSpan.Milliseconds}ms"); + _logger.LogDebug($"[{_workerSettings.WorkerId}] Sleeping for {timeSpan.TotalMilliseconds}ms"); Thread.Sleep(timeSpan); } @@ -349,4 +349,4 @@ private void LogInfo() { } } -} \ No newline at end of file +}