Compare commits

...

1 Commits

Author SHA1 Message Date
Mahmoud Emad
ba07f85fd8 feat: Improve Redis startup handling in install script
- Handle Redis startup differently for GitHub Actions on macOS:
  Start redis directly instead of relying on `brew services`.
- Improved error handling for redis start failures.
- Enhanced logging for better troubleshooting.
2025-03-24 13:12:48 +02:00

View File

@@ -375,11 +375,29 @@ check_and_start_redis() {
fi
fi
elif [[ "${OSNAME}" == "darwin"* ]]; then
if brew services list | grep -q "^redis.*started"; then
echo "redis is already running."
# Check if we're in GitHub Actions
if is_github_actions; then
echo "Running in GitHub Actions on macOS. Starting redis directly..."
if pgrep redis-server > /dev/null; then
echo "redis is already running."
else
echo "redis is not running. Starting it in the background..."
redis-server --daemonize yes
if pgrep redis-server > /dev/null; then
echo "redis started successfully."
else
echo "Failed to start redis. Please check logs for details."
exit 1
fi
fi
else
echo "redis is not running. Starting it..."
brew services start redis
# For regular macOS environments, use brew services
if brew services list | grep -q "^redis.*started"; then
echo "redis is already running."
else
echo "redis is not running. Starting it..."
brew services start redis
fi
fi
elif [[ "${OSNAME}" == "alpine"* ]]; then
if rc-service "redis" status | grep -q "running"; then