chore(schedule): INC ingest cron -> every 20 min, 06:00-20:40 EAT
Was hourly at :15 (15 7-19 * * *); now */20 6-20 * * * for fresher ticket data through the working day. Updates the documented schedule in the Coolify Scheduled Task command, run_ingest.sh, Dockerfile, README, and implementation notes (the live schedule is set in the Coolify UI). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
509338c076
commit
7d3bba8d78
4 changed files with 7 additions and 7 deletions
|
|
@ -1,7 +1,7 @@
|
|||
# fleettickets — INC ingestion image (Coolify-deployable).
|
||||
# A small batch/cron worker: it has no web server. Coolify keeps the container
|
||||
# running (CMD below) and fires the ingest via a Scheduled Task:
|
||||
# python import_tickets.py --from-bucket --apply (cron: 15 7-19 * * *)
|
||||
# python import_tickets.py --from-bucket --apply (cron: */20 6-20 * * *)
|
||||
# Env (set in Coolify): DATABASE_URL, RUSTFS_*, GEOCODER_*. S3 is via boto3 — no
|
||||
# aws CLI needed. psycopg2-binary ships its own libpq, so no build toolchain.
|
||||
FROM python:3.12-slim
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ Coolify builds it and keeps the container alive (`CMD tail -f /dev/null`); the i
|
|||
runs as a **Scheduled Task**, not a system crontab:
|
||||
|
||||
- **Command:** `python import_tickets.py --from-bucket --apply`
|
||||
- **Frequency:** `15 7-19 * * *` (`:15` past each hour, **07:15–19:15 EAT**). This
|
||||
- **Frequency:** `*/20 6-20 * * *` (every 20 min, **06:00–20:40 EAT**). This
|
||||
Coolify instance runs scheduled tasks in **EAT (Africa/Nairobi)**, so no UTC
|
||||
conversion is needed.
|
||||
- **Env vars** (Coolify → Environment Variables): `DATABASE_URL` (internal DB host),
|
||||
|
|
@ -118,7 +118,7 @@ The watermark makes a run with no new change files a cheap no-op.
|
|||
|
||||
For a plain host/VM instead of Coolify, [`run_ingest.sh`](run_ingest.sh) loads `.env`
|
||||
and runs the ingest; schedule it with a crontab line
|
||||
(`CRON_TZ=Africa/Nairobi` / `15 7-19 * * *`).
|
||||
(`CRON_TZ=Africa/Nairobi` / `*/20 6-20 * * *`).
|
||||
|
||||
### Bucket cutover (one-time reseed)
|
||||
|
||||
|
|
@ -212,7 +212,7 @@ Findings to keep in mind (see the PRD for detail):
|
|||
|
||||
## Status / roadmap
|
||||
|
||||
Live: INC ingestion deployed on Coolify (hourly `15 7-19 * * *` EAT), schema +
|
||||
Live: INC ingestion deployed on Coolify (every 20 min `*/20 6-20 * * *` EAT), schema +
|
||||
generated columns + geocoding + the `inc_open_sla` view in `tracksolid_db`.
|
||||
Next (Phase 2): time-series analytics (closure rate, MTTR/SLA trends), then FleetNow
|
||||
vehicle **dispatch** off `geog`, and **team closure attribution**. **CRQ** is a
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ What is actually built and deployed, as of the Phase-1 completion. Companion to
|
|||
`TZ=Africa/Nairobi`, keep-alive `tail -f /dev/null`). Separate from the FleetOps
|
||||
web app (`fleet-ops-staging`).
|
||||
- **Scheduled Task:** `python import_tickets.py --from-bucket --apply`, cron
|
||||
`15 7-19 * * *` in **EAT** (Coolify runs tasks in EAT — no UTC conversion).
|
||||
`*/20 6-20 * * *` in **EAT** (Coolify runs tasks in EAT — no UTC conversion).
|
||||
- **Env vars** (Coolify): `DATABASE_URL` (internal DB host), `RUSTFS_*`, `GEOCODER_*`.
|
||||
- For a plain host/VM, `run_ingest.sh` + a crontab line is the alternative.
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
# Loads env from the local .env (DATABASE_URL + RUSTFS_* + GEOCODER_*) and runs the
|
||||
# newest-INC-CSV ingest with --apply (skip-if-unchanged + archive are built in).
|
||||
#
|
||||
# Install on the instance (ingest at :15, 07:00–19:00 EAT):
|
||||
# 15 7-19 * * * /opt/fleettickets/run_ingest.sh >> /var/log/fleettickets-inc.log 2>&1
|
||||
# Install on the instance (ingest every 20 min, 06:00–20:40 EAT):
|
||||
# */20 6-20 * * * /opt/fleettickets/run_ingest.sh >> /var/log/fleettickets-inc.log 2>&1
|
||||
# Ensure the crontab runs in the Africa/Nairobi timezone (CRON_TZ=Africa/Nairobi or
|
||||
# the host/container TZ), since the export filenames and the schedule are EAT.
|
||||
set -euo pipefail
|
||||
|
|
|
|||
Loading…
Reference in a new issue