From f0831b0f98d7c9bcc598fa2ebe772384fb29bc02 Mon Sep 17 00:00:00 2001 From: lsabor Date: Sun, 14 Dec 2025 07:34:59 -0800 Subject: [PATCH] fix/compute-movement-resolved adds support for recalculating movement on questions that are resolved until their movement becomes calculated as 0.0 --- posts/jobs.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/posts/jobs.py b/posts/jobs.py index bd8063abb6..6198700a1e 100644 --- a/posts/jobs.py +++ b/posts/jobs.py @@ -36,7 +36,14 @@ def job_subscription_notify_date(): @dramatiq.actor def job_compute_movement(): chunk_size = 100 - qs = Post.objects.filter_active().filter_questions().prefetch_questions() + base_qs = Post.objects.filter_questions().prefetch_questions() + active = base_qs.filter_active() + # Also include resolved posts that have non-zero movement as they will update to + # having 0.0 movement 7 days after resolution to remove them from the movers feed + resolved_with_movement = base_qs.filter(resolved=True).exclude( + Q(movement=0.0) | Q(movement__isnull=True) + ) + qs = active.union(resolved_with_movement) logger.info(f"Start computing movement for {qs.count()} posts") with (