#!/bin/bash
port=8802

run_cif_dashboard_legacy() {
    fuser -k $port/tcp
    bazel run --config=cuda -c opt //zsaf/server/cif_dashboard:cif_dashboard_legacy -- --server.port $port
}

until run_cif_dashboard_legacy; do
    echo "Service crashed with exit code $?. Restarting in 5 seconds..." >&2
    sleep 5
done
