mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-14 07:43:31 -07:00
Fix concurrency issue in tests
This commit is contained in:
parent
5cef107e98
commit
d5848bebc6
|
|
@ -44,22 +44,13 @@ public static class ExportWrapper
|
||||||
// Perform export only if it hasn't been done before
|
// Perform export only if it hasn't been done before
|
||||||
if (!File.Exists(filePath))
|
if (!File.Exists(filePath))
|
||||||
{
|
{
|
||||||
try
|
await new ExportChannelsCommand
|
||||||
{
|
{
|
||||||
await new ExportChannelsCommand
|
Token = Secrets.DiscordToken,
|
||||||
{
|
ChannelIds = new[] { channelId },
|
||||||
Token = Secrets.DiscordToken,
|
ExportFormat = format,
|
||||||
ChannelIds = new[] { channelId },
|
OutputPath = filePath
|
||||||
ExportFormat = format,
|
}.ExecuteAsync(new FakeConsole());
|
||||||
OutputPath = filePath
|
|
||||||
}.ExecuteAsync(new FakeConsole());
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
// If the export fails, delete the file to prevent it from being used by tests
|
|
||||||
File.Delete(filePath);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return await File.ReadAllTextAsync(filePath);
|
return await File.ReadAllTextAsync(filePath);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue