From 96edcebe59929462a2a9cfb3ba46830f34f6d5eb Mon Sep 17 00:00:00 2001 From: Weihan Li <7604648+WeihanLi@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:48:13 +0800 Subject: [PATCH] use Environment.ProcessId for current processId --- source/Server/Common/Current.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/source/Server/Common/Current.cs b/source/Server/Common/Current.cs index 0d57788c8..883c4a794 100644 --- a/source/Server/Common/Current.cs +++ b/source/Server/Common/Current.cs @@ -4,11 +4,7 @@ namespace SharpLab.Server.Common { public static class Current { - public static readonly int ProcessId = ((Func)(() => { - using (var current = Process.GetCurrentProcess()) { - return current.Id; - } - }))(); + public static readonly int ProcessId = Environment.ProcessId; public static readonly string AssemblyPath = typeof(Current).Assembly.GetAssemblyFile().FullName; }