From 53a90686401019eadbec95a75946b7894fb67648 Mon Sep 17 00:00:00 2001 From: Garrett Stonis Date: Fri, 25 Jul 2025 13:50:57 -0400 Subject: [PATCH] bugfix: Changed all calls of Environment.MachineName to Dns.GetHostName() to better reflect other watchers. Fixes #10 --- ActivityWatchVS/Services/EventService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ActivityWatchVS/Services/EventService.cs b/ActivityWatchVS/Services/EventService.cs index 5313bc5..1c2843d 100644 --- a/ActivityWatchVS/Services/EventService.cs +++ b/ActivityWatchVS/Services/EventService.cs @@ -8,6 +8,7 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; +using System.Net; using System.Net.Sockets; using System.Threading; using System.Threading.Tasks; @@ -77,7 +78,7 @@ internal void Shutdown() private static string GetBucketId(Event ev) { - return $"{ev.Data.BucketIDCustomPart}_{Environment.MachineName}"; + return $"{ev.Data.BucketIDCustomPart}_{Dns.GetHostName()}"; } private bool MergeEventsAndOutFinishedEvent(out Event logEvent) @@ -164,7 +165,7 @@ private async Task PostCreateBucketAsync(string bucket_id, string bucketTy var awBucket = new CreateBucket() { Client = AWPackage.NAME_ACTIVITY_WATCHER, - Hostname = Environment.MachineName, + Hostname = Dns.GetHostName(), Type = bucketType };