From afd44e817ab5edd2bd01950ea3b16edb9b9acaad Mon Sep 17 00:00:00 2001 From: CollinBeczak Date: Tue, 9 Apr 2024 10:05:32 -0500 Subject: [PATCH] make the hour interval base on the modified column instead of the created column. --- app/org/maproulette/models/dal/TaskDAL.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/org/maproulette/models/dal/TaskDAL.scala b/app/org/maproulette/models/dal/TaskDAL.scala index a4eff8d4..36d98448 100644 --- a/app/org/maproulette/models/dal/TaskDAL.scala +++ b/app/org/maproulette/models/dal/TaskDAL.scala @@ -1144,7 +1144,7 @@ class TaskDAL @Inject() ( s"""NOT (tasks.status != ${Task.STATUS_CREATED} AND tasks.id IN ( |SELECT task_id FROM status_actions |WHERE osm_user_id IN (${user.osmProfile.id}) - | AND created >= NOW() - '1 hour'::INTERVAL))""".stripMargin + | AND modified >= NOW() - '1 hour'::INTERVAL))""".stripMargin ) priority match { @@ -1273,7 +1273,7 @@ class TaskDAL @Inject() ( tasks.status IN (0, 3, 6) AND NOT tasks.id IN ( SELECT task_id FROM status_actions - WHERE osm_user_id = ${user.osmProfile.id} AND created >= NOW() - '1 hour'::INTERVAL) + WHERE osm_user_id = ${user.osmProfile.id} AND modified >= NOW() - '1 hour'::INTERVAL) ORDER BY ST_Distance(tasks.location, (SELECT location FROM tasks WHERE id = $proximityId)), tasks.status, RANDOM() LIMIT ${this.sqlLimit(limit)}"""