mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-20 00:43:36 +03:00
Resolving issues...
Signed-off-by: Macintosh II <mctaylxrs@outlook.com>
This commit is contained in:
parent
4c7b80d458
commit
8384413937
1 changed files with 6 additions and 6 deletions
|
@ -78,7 +78,7 @@ public sealed class GuildDataService : IHostedService
|
||||||
var settingsPath = $"{path}/Settings.json";
|
var settingsPath = $"{path}/Settings.json";
|
||||||
var scheduledEventsPath = $"{path}/ScheduledEvents.json";
|
var scheduledEventsPath = $"{path}/ScheduledEvents.json";
|
||||||
|
|
||||||
await MigrateGuildData(guildId, path);
|
MigrateGuildData(guildId, path);
|
||||||
|
|
||||||
Directory.CreateDirectory(path);
|
Directory.CreateDirectory(path);
|
||||||
|
|
||||||
|
@ -130,17 +130,17 @@ public sealed class GuildDataService : IHostedService
|
||||||
return finalData;
|
return finalData;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Task MigrateGuildData(Snowflake guildId, string path)
|
private void MigrateGuildData(Snowflake guildId, string newPath)
|
||||||
{
|
{
|
||||||
var oldPath = $"{guildId}";
|
var oldPath = $"{guildId}";
|
||||||
|
|
||||||
if (Directory.Exists(oldPath))
|
if (Directory.Exists(oldPath))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory($"{path}/..");
|
Directory.CreateDirectory($"{newPath}/..");
|
||||||
Directory.Move(oldPath, path);
|
Directory.Move(oldPath, newPath);
|
||||||
}
|
|
||||||
|
|
||||||
return Task.CompletedTask;
|
_logger.LogInformation($"Migrated GuildData: \"{oldPath}\" -> \"{newPath}\"");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<JsonNode> GetSettings(Snowflake guildId, CancellationToken ct = default)
|
public async Task<JsonNode> GetSettings(Snowflake guildId, CancellationToken ct = default)
|
||||||
|
|
Loading…
Add table
Reference in a new issue