Revert "retrofix chat owners"

This reverts commit 68c91d8d8b.
pull/226/head
Aevann 2024-04-09 09:25:23 +02:00
parent 68c91d8d8b
commit 84b705697d
2 changed files with 1 additions and 17 deletions

View File

@ -9,22 +9,6 @@ from files.helpers.get import *
from files.__main__ import app, limiter
@app.get("/retrofix")
@admin_level_required(5)
def chats_retrofix(v):
for chat in g.db.query(Chat).order_by(Chat.id):
if chat.id == 1: continue
owner_id = g.db.query(ChatMessage.user_id).filter_by(chat_id=chat.id).order_by(ChatMessage.created_utc).first()
print(chat.id, owner_id, flush=True)
if owner_id:
owner_id = owner_id[0]
membership = g.db.query(ChatMembership).filter_by(chat_id=chat.id, user_id=owner_id).one_or_none()
if membership:
membership.created_utc -= 1
g.db.add(membership)
return ('success')
@app.get("/chat")
@app.get("/orgy")
def chat_redirect():

View File

@ -6,7 +6,7 @@ bind = '0.0.0.0:5000'
worker_class = 'gevent'
workers = int(environ.get("WORKER_COUNT").strip())
timeout = 120
max_requests = 5000
max_requests_jitter = 10000