fix(bot): quick fix for timescaledb issues
This commit is contained in:
		@@ -44,6 +44,9 @@ public partial class ModelRepository
 | 
			
		||||
 | 
			
		||||
    public async Task DeleteMessage(ulong id)
 | 
			
		||||
    {
 | 
			
		||||
        _logger.Warning("not deleting message from database because of database issues", id);
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
        var query = new Query("messages").AsDelete().Where("mid", id);
 | 
			
		||||
        var rowCount = await _db.ExecuteQuery(query, messages: true);
 | 
			
		||||
        if (rowCount > 0)
 | 
			
		||||
@@ -52,6 +55,9 @@ public partial class ModelRepository
 | 
			
		||||
 | 
			
		||||
    public async Task DeleteMessagesBulk(IReadOnlyCollection<ulong> ids)
 | 
			
		||||
    {
 | 
			
		||||
        _logger.Warning("not bulk deleting {count} messages from database because of database issues", ids.Count, ids);
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
        // Npgsql doesn't support ulongs in general - we hacked around it for plain ulongs but tbh not worth it for collections of ulong
 | 
			
		||||
        // Hence we map them to single longs, which *are* supported (this is ok since they're Technically (tm) stored as signed longs in the db anyway)
 | 
			
		||||
        var query = new Query("messages").AsDelete().WhereIn("mid", ids.Select(id => (long)id).ToArray());
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user