diff --git a/webapp/titanembeds/blueprints/api/api.py b/webapp/titanembeds/blueprints/api/api.py index a5f474d..92cfcc5 100644 --- a/webapp/titanembeds/blueprints/api/api.py +++ b/webapp/titanembeds/blueprints/api/api.py @@ -435,17 +435,5 @@ def cleanup_keyval_db(): if canCleanupDB(): db.session.query(KeyValueProperties).filter(KeyValueProperties.expiration < datetime.datetime.now()).delete() db.session.commit() - - guilds = Guilds.query.all() - for guild in guilds: - try: - channelsjson = json.loads(guild.channels) - except: - continue - for channel in channelsjson: - chanid = channel["id"] - keep_these = db.session.query(Messages.id).filter(Messages.channel_id == chanid).order_by(Messages.timestamp.desc()).limit(50) - db.session.query(Messages).filter(Messages.channel_id == chanid, ~Messages.id.in_(keep_these)).delete(synchronize_session=False) - db.session.commit() return ('', 204) abort(401) diff --git a/webapp/titanembeds/templates/admin_index.html.j2 b/webapp/titanembeds/templates/admin_index.html.j2 index 55f76db..5201f37 100644 --- a/webapp/titanembeds/templates/admin_index.html.j2 +++ b/webapp/titanembeds/templates/admin_index.html.j2 @@ -30,7 +30,7 @@
Clears the keyval caches and purges the old messages. (Hit once, and wait a minute)
+Clears the keyval caches. (Hit once, and wait a minute)
Run DB Cleanup Task