Implement spotting to Tiles on the Air. #95

This commit is contained in:
Ian Renton
2026-06-13 08:17:38 +01:00
parent 1afb407ca5
commit fd21e01c9d
13 changed files with 95 additions and 36 deletions

View File

@@ -1,6 +1,7 @@
import json
import logging
import re
import threading
from datetime import datetime
import pytz
@@ -175,8 +176,8 @@ class APISpotHandler(tornado.web.RequestHandler):
try:
# Submit spot to the upstream provider
provider.submit_spot(spot, upstream_credentials)
# Trigger an immediate re-poll so the spot appears quickly
provider.force_poll()
# Trigger a re-poll after 1 second so the spot appears quickly
threading.Timer(1.0, lambda: provider.force_poll()).start()
except NotImplementedError as e:
upstream_warning = str(e)
except Exception as e: