mirror of
				https://github.com/TitanEmbeds/Titan.git
				synced 2025-11-04 07:47:10 +01:00 
			
		
		
		
	Fix issue of offset and delete
Sqlalchemy doesnt like it, idk y attempt fix again
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							44af174287
						
					
				
				
					commit
					fc7e74cbe3
				
			@@ -478,7 +478,9 @@ def cleanup_keyval_db():
 | 
				
			|||||||
                continue
 | 
					                continue
 | 
				
			||||||
            for channel in channelsjson:
 | 
					            for channel in channelsjson:
 | 
				
			||||||
                chanid = channel["id"]
 | 
					                chanid = channel["id"]
 | 
				
			||||||
                db.session.query(Messages).filter(Messages.channel_id == chanid).order_by(Messages.timestamp.desc()).offset(50).delete()
 | 
					                msgs = db.session.query(Messages).filter(Messages.channel_id == chanid).order_by(Messages.timestamp.desc()).offset(50).all()
 | 
				
			||||||
 | 
					                for msg in msgs:
 | 
				
			||||||
 | 
					                    db.session.delete(msg)
 | 
				
			||||||
            db.session.commit()
 | 
					            db.session.commit()
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
        return ('', 204)
 | 
					        return ('', 204)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user