forked from potpie-ai/potpie
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_event_worker.sh
More file actions
executable file
·46 lines (39 loc) · 1.37 KB
/
start_event_worker.sh
File metadata and controls
executable file
·46 lines (39 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# Start Event Bus Worker Script
# This script starts a Celery worker specifically for event bus tasks
echo "🚀 Starting Event Bus Worker..."
echo "==============================="
# Check if Redis is running
if ! redis-cli ping > /dev/null 2>&1; then
echo "❌ Redis is not running. Please start Redis first."
echo " You can start Redis with: redis-server"
exit 1
fi
echo "✅ Redis is running"
# Start the event bus worker
echo "👷 Starting event bus worker..."
nohup uv run celery -A app.celery.celery_app worker \
--loglevel=info \
--queues=external-event \
--concurrency=2 \
--hostname=event-worker@%h \
> event_worker.log 2>&1 &
WORKER_PID=$!
echo "✅ Event bus worker started with PID: $WORKER_PID"
echo "📝 Logs are being written to: event_worker.log"
echo ""
echo "🔧 Commands:"
echo " • View logs: tail -f event_worker.log"
echo " • Stop worker: kill $WORKER_PID"
echo " • Test events: python test_event_publisher.py"
echo ""
echo "📊 The worker is now processing:"
echo " • external-event-webhook"
echo " • external-event-custom"
echo " • external-event-linear"
echo " • external-event-sentry"
echo ""
echo "💡 Run 'python test_event_publisher.py' to test event processing!"
# Save PID to file for easy stopping
echo $WORKER_PID > event_worker.pid
echo "💾 Worker PID saved to: event_worker.pid"