redaction (#1)
Add the redacted source file for demo purposes Reviewed-on: https://source.michaeldileo.org/michael_dileo/Keybard-Vagabond-Demo/pulls/1 Co-authored-by: Michael DiLeo <michael_dileo@proton.me> Co-committed-by: Michael DiLeo <michael_dileo@proton.me>
This commit was merged in pull request #1.
This commit is contained in:
42
build/bookwyrm/bookwyrm-worker/entrypoint-worker.sh
Normal file
42
build/bookwyrm/bookwyrm-worker/entrypoint-worker.sh
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
# BookWyrm Worker Container Entrypoint
|
||||
# Simplified - init containers handle Redis readiness
|
||||
|
||||
set -e
|
||||
|
||||
echo "[$(date +'%Y-%m-%d %H:%M:%S')] Starting BookWyrm Worker Container..."
|
||||
|
||||
# Only handle worker-specific tasks (Redis handled by init container)
|
||||
|
||||
# Create temp directory for worker processes
|
||||
mkdir -p /tmp/bookwyrm
|
||||
chown bookwyrm:bookwyrm /tmp/bookwyrm
|
||||
|
||||
# Clean up any stale supervisor sockets and pid files
|
||||
rm -f /tmp/bookwyrm-supervisor.sock
|
||||
rm -f /tmp/supervisord-worker.pid
|
||||
|
||||
# Test Celery connectivity (quick verification)
|
||||
echo "[$(date +'%Y-%m-%d %H:%M:%S')] Testing Celery broker connectivity..."
|
||||
python -c "
|
||||
from celery import Celery
|
||||
import os
|
||||
|
||||
app = Celery('bookwyrm')
|
||||
app.config_from_object('django.conf:settings', namespace='CELERY')
|
||||
|
||||
try:
|
||||
# Test broker connection
|
||||
with app.connection() as conn:
|
||||
conn.ensure_connection(max_retries=3)
|
||||
print('✓ Celery broker connection successful')
|
||||
except Exception as e:
|
||||
print(f'✗ Celery broker connection failed: {e}')
|
||||
exit(1)
|
||||
"
|
||||
|
||||
echo "[$(date +'%Y-%m-%d %H:%M:%S')] BookWyrm worker container initialization completed"
|
||||
echo "[$(date +'%Y-%m-%d %H:%M:%S')] Starting worker services..."
|
||||
|
||||
# Execute the provided command (usually supervisord)
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user