0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-22 08:40:03 +01:00
posthog/rust/bin/start-hoghooks
Brett Hoerner 8f4df45984
feat: make rusty-hook Hog-aware, sending responses back via kafka (#23619)
Co-authored-by: Ben White <ben@posthog.com>
2024-07-16 11:12:48 -06:00

25 lines
555 B
Bash
Executable File

#!/bin/bash
set -ex
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
cargo build
export RUST_LOG=${DEBUG:-debug}
SQLX_QUERY_LEVEL=${SQLX_QUERY_LEVEL:-warn}
export RUST_LOG=$RUST_LOG,sqlx::query=$SQLX_QUERY_LEVEL
export HOG_MODE=true
DATABASE_NAME=${DEBUG:-hoghooks}
export DATABASE_URL=postgres://posthog:posthog@localhost:5432/$DATABASE_NAME
export ALLOW_INTERNAL_IPS=true
sqlx database create -D "$DATABASE_URL"
sqlx migrate run -D "$DATABASE_URL"
./target/debug/hook-api &
./target/debug/hook-worker &
./target/debug/hook-janitor &
wait