diff options
| author | Max Nanis | 2026-02-27 19:43:20 -0500 |
|---|---|---|
| committer | Max Nanis | 2026-02-27 19:43:20 -0500 |
| commit | 758d60f4b6e46b2b601518cebee9af3b777f3c50 (patch) | |
| tree | 333f71cadf4a530d5da2f0169e9c9b74aec95b3b /jb/flow | |
| parent | 3fda1fcd7b610947b21fc20efcfeab1bf1add7b0 (diff) | |
| download | amt-jb-758d60f4b6e46b2b601518cebee9af3b777f3c50.tar.gz amt-jb-758d60f4b6e46b2b601518cebee9af3b777f3c50.zip | |
Fix amt manager on check_stale_hits and other tasks.
Diffstat (limited to 'jb/flow')
| -rw-r--r-- | jb/flow/tasks.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/jb/flow/tasks.py b/jb/flow/tasks.py index 808c8f7..77825d3 100644 --- a/jb/flow/tasks.py +++ b/jb/flow/tasks.py @@ -4,10 +4,9 @@ from typing import TypedDict, cast from generalresearchutils.config import is_debug -from jb.decorators import HTM, HM, HQM, pg_config +from jb.decorators import AMTM, HTM, HM, HQM, pg_config from jb.flow.maintenance import check_hit_status from jb.flow.monitoring import write_hit_gauge, emit_hit_event -from jb.managers.amt import AMTManager from jb.models.definitions import HitStatus from jb.models.hit import HitType, HitQuestion, Hit @@ -37,6 +36,7 @@ def check_stale_hits(): for hit in cast(list[HitRow], res): logging.info(f"check_stale_hits: {hit["amt_hit_id"]}") check_hit_status( + amtm=AMTM, amt_hit_id=hit["amt_hit_id"], amt_hit_type_id=hit["amt_hit_type_id"], reason="cleanup", @@ -58,6 +58,7 @@ def check_expired_hits(): for hit in cast(list[HitRow], res): logging.info(f"check_expired_hits: {hit["amt_hit_id"]}") check_hit_status( + amtm=AMTM, amt_hit_id=hit["amt_hit_id"], amt_hit_type_id=hit["amt_hit_type_id"], reason="expired", @@ -73,7 +74,7 @@ def create_hit_from_hittype(hit_type: HitType) -> Hit: HitQuestion(height=800, url="https://jamesbillings67.com/work/") ) - hit = AMTManager.create_hit_with_hit_type(hit_type=hit_type, question=question) + hit = AMTM.create_hit_with_hit_type(hit_type=hit_type, question=question) HM.create(hit) emit_hit_event(status=hit.status, amt_hit_type_id=hit.amt_hit_type_id) return hit |
