measure /post time

pull/117/head
Aevann 2023-02-10 14:02:00 +02:00
parent 83195cded9
commit 54800df9f0
1 changed files with 8 additions and 1 deletions

View File

@ -82,6 +82,9 @@ def submit_get(v:User, sub=None):
@app.get("/h/<sub>/post/<int:pid>/<anything>")
@auth_desired_with_logingate
def post_id(pid, anything=None, v=None, sub=None):
if v.id == AEVANN_ID and post.id == 18459:
print(t = time.time())
post = get_post(pid, v=v)
if not User.can_see(v, post): abort(403)
@ -169,10 +172,14 @@ def post_id(pid, anything=None, v=None, sub=None):
and not (v and (v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or post.author_id == v.id)):
template = "submission_banned.html"
return render_template(template, v=v, p=post, ids=list(ids),
x = render_template(template, v=v, p=post, ids=list(ids),
sort=sort, render_replies=True, offset=offset, sub=post.subr,
fart=get_setting('fart_mode'))
if v.id == AEVANN_ID and post.id == 18459:
print(time.time() - t)
return x
@app.get("/view_more/<int:pid>/<sort>/<offset>")
@limiter.limit(DEFAULT_RATELIMIT_SLOWER)
@auth_desired_with_logingate