From 4e89d7b12ff36e8eac8b3e4026101465f91155c1 Mon Sep 17 00:00:00 2001
From: chylex <contact@chylex.com>
Date: Thu, 11 Apr 2024 05:41:05 +0200
Subject: [PATCH] Fix instance stop timeout not killing the process

Caused by 72ddaf91.
---
 .../Instances/State/InstanceStopProcedure.cs                    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Agent/Phantom.Agent.Services/Instances/State/InstanceStopProcedure.cs b/Agent/Phantom.Agent.Services/Instances/State/InstanceStopProcedure.cs
index 560e454..464a419 100644
--- a/Agent/Phantom.Agent.Services/Instances/State/InstanceStopProcedure.cs
+++ b/Agent/Phantom.Agent.Services/Instances/State/InstanceStopProcedure.cs
@@ -85,7 +85,7 @@ static class InstanceStopProcedure {
 	private static async Task WaitForSessionToEnd(InstanceContext context, InstanceProcess process) {
 		try {
 			await process.WaitForExit(TimeSpan.FromSeconds(55));
-		} catch (OperationCanceledException) {
+		} catch (TimeoutException) {
 			try {
 				context.Logger.Warning("Waiting timed out, killing session...");
 				process.Kill();