Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ CancellationToken cancellationToken

await DoWorkAsync(engineId, buildId, data, buildOptions, cancellationToken);
}
catch (OperationCanceledException)
catch (OperationCanceledException e)
{
// Log the full exception for debugging purposes
Logger.LogInformation(e, "Build Hangfire job canceled ({0})", buildId);

// Check if the cancellation was initiated by an API call or a shutdown.
TEngine? engine = await Engines.GetAsync(
e => e.EngineId == engineId && e.CurrentBuild != null && e.CurrentBuild.BuildId == buildId,
Expand Down Expand Up @@ -93,10 +96,12 @@ await DataAccessContext.WithTransactionAsync(
},
cancellationToken: CancellationToken.None
);
Logger.LogInformation("Build restarting ({0})", buildId);
throw;
}
else
{
Logger.LogInformation("Build engine not found ({0})", buildId);
completionStatus = JobCompletionStatus.Canceled;
}
}
Expand Down
Loading