try random shit to fix posting in WPD

master
Aevann 2023-08-17 00:14:11 +03:00
parent ac8d2159e9
commit 12fbd8da83
3 changed files with 5 additions and 4 deletions

View File

@ -1157,5 +1157,5 @@ GIRL_NAMES = {
from sqlalchemy.engine.create import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
engine = create_engine(environ.get("DATABASE_URL").strip(), connect_args={"options": "-c statement_timeout=5000 -c idle_in_transaction_session_timeout=40000"})
engine = create_engine(environ.get("DATABASE_URL").strip(), connect_args={"options": "-c statement_timeout=5000 -c idle_in_transaction_session_timeout=59000"})
db_session = scoped_session(sessionmaker(bind=engine))

View File

@ -62,7 +62,7 @@ def after_request(response):
if hasattr(g, 'v') and g.v:
user_id = g.v.id
if not session.get("GLOBAL") and request.method == "POST":
if SITE != 'watchpeopledie.tv' and not session.get("GLOBAL") and request.method == "POST":
timestamp = int(time.time())
if (g.v.last_active + LOGGEDIN_ACTIVE_TIME) < timestamp:
g.v.last_active = timestamp

View File

@ -73,7 +73,8 @@ def publish(pid, v):
cache.delete_memoized(frontlist)
cache.delete_memoized(userpagelisting)
execute_snappy(p, v)
if SITE != 'watchpeopledie.tv':
execute_snappy(p, v)
return {"message": "Post has been published successfully!"}
@ -679,7 +680,7 @@ def submit_post(v, sub=None):
for key in redis_instance.scan_iter(key_pattern):
redis_instance.delete(key)
if not p.private:
if SITE != 'watchpeopledie.tv' and not p.private:
execute_snappy(p, v)
g.db.commit() #Necessary, do NOT remove