Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Conductor/Client/Worker/WorkflowTaskExecutor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Copyright 2024 Conductor Authors.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
Expand Down Expand Up @@ -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)
{
Expand All @@ -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();
Expand Down Expand Up @@ -201,7 +201,7 @@ private async void WorkOnce(CancellationToken token)
}
}

private async void ProcessTasks(List<Models.Task> tasks, CancellationToken token)
private async System.Threading.Tasks.Task ProcessTasks(List<Models.Task> tasks, CancellationToken token)
{
List<System.Threading.Tasks.Task> threads = new List<System.Threading.Tasks.Task>();
if (tasks == null || tasks.Count == 0)
Expand All @@ -221,7 +221,7 @@ private async void ProcessTasks(List<Models.Task> 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();
Expand Down Expand Up @@ -341,12 +341,12 @@ 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);
}

private void LogInfo()
{
}
}
}
}
Loading