fix: don't use Task.WhenAll() in message responders, it breaks ignoring them for some reason
This commit is contained in:
parent
be8bc9b199
commit
8ae4ba722a
2 changed files with 26 additions and 22 deletions
|
|
@ -148,16 +148,20 @@ public partial class PkMessageHandler(ILogger logger, IServiceProvider services)
|
||||||
await using var messageRepository =
|
await using var messageRepository =
|
||||||
scope.ServiceProvider.GetRequiredService<MessageRepository>();
|
scope.ServiceProvider.GetRequiredService<MessageRepository>();
|
||||||
|
|
||||||
await Task.WhenAll(
|
_logger.Debug(
|
||||||
messageRepository.SetProxiedMessageDataAsync(
|
"Setting proxy data for {MessageId} and ignoring {OriginalId}",
|
||||||
|
msgId,
|
||||||
|
originalId
|
||||||
|
);
|
||||||
|
|
||||||
|
await messageRepository.SetProxiedMessageDataAsync(
|
||||||
msgId,
|
msgId,
|
||||||
originalId,
|
originalId,
|
||||||
authorId,
|
authorId,
|
||||||
systemId: match.Groups[1].Value,
|
systemId: match.Groups[1].Value,
|
||||||
memberId: match.Groups[2].Value
|
memberId: match.Groups[2].Value
|
||||||
),
|
|
||||||
messageRepository.IgnoreMessageAsync(originalId)
|
|
||||||
);
|
);
|
||||||
|
await messageRepository.IgnoreMessageAsync(originalId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task HandleProxiedMessageAsync(ulong msgId)
|
public async Task HandleProxiedMessageAsync(ulong msgId)
|
||||||
|
|
@ -189,15 +193,19 @@ public partial class PkMessageHandler(ILogger logger, IServiceProvider services)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await Task.WhenAll(
|
_logger.Debug(
|
||||||
messageRepository.SetProxiedMessageDataAsync(
|
"Setting proxy data for {MessageId} and ignoring {OriginalId}",
|
||||||
|
msgId,
|
||||||
|
pkMessage.Original
|
||||||
|
);
|
||||||
|
|
||||||
|
await messageRepository.SetProxiedMessageDataAsync(
|
||||||
msgId,
|
msgId,
|
||||||
pkMessage.Original,
|
pkMessage.Original,
|
||||||
pkMessage.Sender,
|
pkMessage.Sender,
|
||||||
pkMessage.System?.Id,
|
pkMessage.System?.Id,
|
||||||
pkMessage.Member?.Id
|
pkMessage.Member?.Id
|
||||||
),
|
|
||||||
messageRepository.IgnoreMessageAsync(pkMessage.Original)
|
|
||||||
);
|
);
|
||||||
|
await messageRepository.IgnoreMessageAsync(pkMessage.Original);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,4 @@
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.1"/>
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.1"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Database\Dapper\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue