deploy Maps v12 update
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@ GMAPS_API_MODE=standard
|
|||||||
GMAPS_API_KEY=
|
GMAPS_API_KEY=
|
||||||
|
|
||||||
# A single personal run may take several minutes.
|
# A single personal run may take several minutes.
|
||||||
GMAPS_REQUEST_TIMEOUT=300
|
GMAPS_REQUEST_TIMEOUT=900
|
||||||
GMAPS_POLL_SECONDS=2
|
GMAPS_POLL_SECONDS=2
|
||||||
|
|
||||||
# Optional OpenAI-compatible provider for AI analysis and tailored drafts.
|
# Optional OpenAI-compatible provider for AI analysis and tailored drafts.
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ error rather than remaining stuck forever.
|
|||||||
| `GMAPS_HOST_PORT` | `8081` | Host port for the Maps worker admin UI |
|
| `GMAPS_HOST_PORT` | `8081` | Host port for the Maps worker admin UI |
|
||||||
| `GMAPS_API_MODE` | `standard` | `standard` for the bundled worker; `saas` only for the optional SaaS API |
|
| `GMAPS_API_MODE` | `standard` | `standard` for the bundled worker; `saas` only for the optional SaaS API |
|
||||||
| `GMAPS_API_KEY` | empty | Not required in standard mode; only used in SaaS mode |
|
| `GMAPS_API_KEY` | empty | Not required in standard mode; only used in SaaS mode |
|
||||||
| `GMAPS_REQUEST_TIMEOUT` | `300` | Per-job scraper timeout in seconds |
|
| `GMAPS_REQUEST_TIMEOUT` | `900` | Maximum wait for the Maps worker in seconds; raise it for very large searches |
|
||||||
| `GMAPS_POLL_SECONDS` | `2` | Poll interval while a job is running |
|
| `GMAPS_POLL_SECONDS` | `2` | Poll interval while a job is running |
|
||||||
| `DISCOVERY_BACKEND` | `gmaps` when `GMAPS_URL` is set | Set to `browser` only for the bounded public-search fallback |
|
| `DISCOVERY_BACKEND` | `gmaps` when `GMAPS_URL` is set | Set to `browser` only for the bounded public-search fallback |
|
||||||
| `AI_BASE_URL` | empty | Optional OpenAI-compatible `/chat/completions` endpoint |
|
| `AI_BASE_URL` | empty | Optional OpenAI-compatible `/chat/completions` endpoint |
|
||||||
|
|||||||
+14
-1
@@ -33,7 +33,10 @@ except ImportError: # tests import the module as api.server
|
|||||||
DB_PATH = os.environ.get("PROSPECT_DB", "/data/prospects.db")
|
DB_PATH = os.environ.get("PROSPECT_DB", "/data/prospects.db")
|
||||||
MAX_RESULTS = 50
|
MAX_RESULTS = 50
|
||||||
GMAPS_POLL_SECONDS = float(os.environ.get("GMAPS_POLL_SECONDS", "2"))
|
GMAPS_POLL_SECONDS = float(os.environ.get("GMAPS_POLL_SECONDS", "2"))
|
||||||
GMAPS_REQUEST_TIMEOUT = int(os.environ.get("GMAPS_REQUEST_TIMEOUT", "300"))
|
# Maps searches can legitimately take several minutes, especially when email
|
||||||
|
# extraction is enabled. Fifteen minutes is the safe default; it remains
|
||||||
|
# configurable for smaller or larger personal runs.
|
||||||
|
GMAPS_REQUEST_TIMEOUT = int(os.environ.get("GMAPS_REQUEST_TIMEOUT", "900"))
|
||||||
GMAPS_URL = os.environ.get("GMAPS_URL", "").strip().rstrip("/")
|
GMAPS_URL = os.environ.get("GMAPS_URL", "").strip().rstrip("/")
|
||||||
# The bundled gosom/google-maps-scraper image exposes a local, unauthenticated
|
# The bundled gosom/google-maps-scraper image exposes a local, unauthenticated
|
||||||
# REST API. The optional SaaS edition uses a different API and requires an
|
# REST API. The optional SaaS edition uses a different API and requires an
|
||||||
@@ -561,6 +564,16 @@ def poll_gmaps_job(job_id: str, progress: Callable[[str, int, int], None] | None
|
|||||||
error = field_value(response, "error", "Error")
|
error = field_value(response, "error", "Error")
|
||||||
raise RuntimeError("gmaps_job_" + status + (":" + as_text(error) if error else ""))
|
raise RuntimeError("gmaps_job_" + status + (":" + as_text(error) if error else ""))
|
||||||
time.sleep(max(0.5, GMAPS_POLL_SECONDS))
|
time.sleep(max(0.5, GMAPS_POLL_SECONDS))
|
||||||
|
# The worker can finish writing its CSV just after its status endpoint
|
||||||
|
# exceeds our polling window. Recover a completed/partial result when it
|
||||||
|
# is available rather than discarding the run as a false failure.
|
||||||
|
if GMAPS_API_MODE == "standard":
|
||||||
|
try:
|
||||||
|
recovered = download_standard_results(job_id)
|
||||||
|
if recovered:
|
||||||
|
return recovered
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
raise RuntimeError("gmaps_job_timeout")
|
raise RuntimeError("gmaps_job_timeout")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ services:
|
|||||||
GMAPS_URL: ${GMAPS_URL:-http://gmaps:8080}
|
GMAPS_URL: ${GMAPS_URL:-http://gmaps:8080}
|
||||||
GMAPS_API_MODE: ${GMAPS_API_MODE:-standard}
|
GMAPS_API_MODE: ${GMAPS_API_MODE:-standard}
|
||||||
GMAPS_API_KEY: ${GMAPS_API_KEY:-}
|
GMAPS_API_KEY: ${GMAPS_API_KEY:-}
|
||||||
GMAPS_REQUEST_TIMEOUT: ${GMAPS_REQUEST_TIMEOUT:-300}
|
GMAPS_REQUEST_TIMEOUT: ${GMAPS_REQUEST_TIMEOUT:-900}
|
||||||
GMAPS_POLL_SECONDS: ${GMAPS_POLL_SECONDS:-2}
|
GMAPS_POLL_SECONDS: ${GMAPS_POLL_SECONDS:-2}
|
||||||
AI_BASE_URL: ${AI_BASE_URL:-}
|
AI_BASE_URL: ${AI_BASE_URL:-}
|
||||||
AI_API_KEY: ${AI_API_KEY:-}
|
AI_API_KEY: ${AI_API_KEY:-}
|
||||||
|
|||||||
Reference in New Issue
Block a user