Only log deleted messages if they were found previously

This commit is contained in:
Ske 2019-07-21 03:44:26 +02:00
parent a674b98c80
commit 3103df856c

View File

@ -223,9 +223,8 @@ namespace PluralKit {
public async Task Delete(ulong id) {
using (var conn = await _conn.Obtain())
await conn.ExecuteAsync("delete from messages where mid = @Id", new { Id = id });
_logger.Information("Deleted message {Message}", id);
if (await conn.ExecuteAsync("delete from messages where mid = @Id", new { Id = id }) > 0)
_logger.Information("Deleted message {Message}", id);
}
public async Task<ulong> Count()