prevent unnecessary db writes

pull/215/head
Aevann 2023-10-06 22:28:32 +03:00
parent f83427bb12
commit 149bfe5c17
1 changed files with 3 additions and 0 deletions

View File

@ -776,6 +776,9 @@ def commenters(v, pid, time):
def postprocess_comment(comment_body, comment_body_html, cid):
with app.app_context():
li = list(reddit_s_url_regex.finditer(comment_body)) + list(tiktok_t_url_regex.finditer(comment_body))
if not li: return
for i in li:
old = i.group(0)
new = normalize_url_gevent(old)