fix(geocode): set geocode_tried_at on successful geocode UPDATE
All checks were successful
CI / changes (push) Successful in 8s
CI / backend-tests (push) Has been skipped
CI / changes (pull_request) Successful in 6s
CI / frontend-tests (push) Has been skipped
CI / openapi-codegen-check (push) Has been skipped
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped
All checks were successful
CI / changes (push) Successful in 8s
CI / backend-tests (push) Has been skipped
CI / changes (pull_request) Successful in 6s
CI / frontend-tests (push) Has been skipped
CI / openapi-codegen-check (push) Has been skipped
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped
Add geocode_tried_at = NOW() to the success UPDATE SET clause so successfully-geocoded listings record their attempt time, matching the per-ID admin endpoint contract and the column spec.
This commit is contained in:
parent
a56420bdfb
commit
17fa6544a2
1 changed files with 3 additions and 2 deletions
|
|
@ -182,12 +182,13 @@ async def geocode_missing_listings(
|
|||
precision: str | None = "city" if _geocode_is_coarse(geo) else None
|
||||
|
||||
# UPDATE listings — PostGIS trigger (listings_set_geom_trg) обновит geom автоматически.
|
||||
# geo_precision проставляется одновременно с координатами.
|
||||
# geo_precision и geocode_tried_at проставляются одновременно с координатами.
|
||||
update_result = db.execute(
|
||||
text(
|
||||
"""
|
||||
UPDATE listings
|
||||
SET lat = :lat, lon = :lon, geo_precision = :precision
|
||||
SET lat = :lat, lon = :lon, geo_precision = :precision,
|
||||
geocode_tried_at = NOW()
|
||||
WHERE address = :addr AND lat IS NULL
|
||||
"""
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue