Files
Openlane/_db_now2.sh

20 lines
634 B
Bash

#!/usr/bin/env bash
set -euo pipefail
cd /root/iaai_scraper_project
echo "== DB =="
docker compose exec -T postgres psql -U iaai -d iaai_scraper -c "
SELECT
count(*) AS total,
count(*) FILTER (WHERE last_seen_at > now() - interval '1 minute') AS l1,
count(*) FILTER (WHERE last_seen_at > now() - interval '5 minutes') AS l5,
count(*) FILTER (WHERE created_at > now() - interval '15 minutes') AS created_15m,
max(last_seen_at) AS max_seen,
max(created_at) AS max_created,
now() AS now_ts
FROM cars;"
echo
echo "== last 50 lines of worker log (everything) =="
docker compose logs --tail=50 worker 2>&1 | tail -n 50