From 8384413937dcdee4869ff843d2c917691d7ed28a Mon Sep 17 00:00:00 2001 From: Macintosh II Date: Fri, 22 Sep 2023 14:42:16 +0300 Subject: [PATCH] Resolving issues... Signed-off-by: Macintosh II --- src/Services/GuildDataService.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Services/GuildDataService.cs b/src/Services/GuildDataService.cs index 512748e..501c953 100644 --- a/src/Services/GuildDataService.cs +++ b/src/Services/GuildDataService.cs @@ -78,7 +78,7 @@ public sealed class GuildDataService : IHostedService var settingsPath = $"{path}/Settings.json"; var scheduledEventsPath = $"{path}/ScheduledEvents.json"; - await MigrateGuildData(guildId, path); + MigrateGuildData(guildId, path); Directory.CreateDirectory(path); @@ -130,17 +130,17 @@ public sealed class GuildDataService : IHostedService return finalData; } - private static Task MigrateGuildData(Snowflake guildId, string path) + private void MigrateGuildData(Snowflake guildId, string newPath) { var oldPath = $"{guildId}"; if (Directory.Exists(oldPath)) { - Directory.CreateDirectory($"{path}/.."); - Directory.Move(oldPath, path); - } + Directory.CreateDirectory($"{newPath}/.."); + Directory.Move(oldPath, newPath); - return Task.CompletedTask; + _logger.LogInformation($"Migrated GuildData: \"{oldPath}\" -> \"{newPath}\""); + } } public async Task GetSettings(Snowflake guildId, CancellationToken ct = default)