Commit graph

9 commits

Author SHA1 Message Date
justcool393
ff09ba4209 SQLA migration: fix RemovedIn20Warnings 2023-02-24 05:54:56 -06:00
TLSM
007f0a3f02 Optimize comment pagination in post_id, viewmore
Against a clean seeded DB, reduces `GET /post/1/` from 63 queries to
26 by removing redundancies and slow lazy-loaded queries during
top comment pagination.

Also applies eager loading to /viewmore/ with the expected reduction
from 5*(N comments) queries to ~12/request.

For testing locally, use a newly seeded DB to ensure
Comment.descendant_count is populated.

Ref: #485
2023-02-08 15:50:24 -06:00
faul_sname
c0a546d779 [themotte/rDrama#451] Passing in the db connection as an optional param makes things easier 2023-01-13 19:33:56 -08:00
faul_sname
e14d1b809c [themotte/rDrama#451] Extract the recomputation of descendant counts to its own function 2023-01-13 19:12:16 -08:00
faul_sname
4a6ed37166 [themotte/rDrama#451] Move the pusher_thread() function from files/routes/comment.py to files/helpers/comment.py 2023-01-09 00:07:49 -08:00
faul_sname
2e29b468ec [themotte/rDrama#451] Add a test for comment.descendant_count accuracy 2023-01-03 01:45:37 -08:00
faul_sname
7d12ddc89e [themotte/rDrama#451] With tests in place, extract out logic for updating the counters 2023-01-03 01:24:20 -08:00
faul_sname
f8c27f3620 [themotte/rDrama#451] define comment_on_unpublish() function 2023-01-03 01:17:00 -08:00
faul_sname
28f4807a9b [themotte/rDrama#451] Move comment_on_publish() to files/helpers/comments.py 2023-01-03 01:11:50 -08:00