Skip to content

Commit

Permalink
Speak to me
Browse files Browse the repository at this point in the history
  • Loading branch information
fidel committed Jan 2, 2025
1 parent 9d68f5e commit 6a870a4
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions support/nix/redis.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,19 @@ mkShell {
--daemonize yes \
--pidfile $PIDFILE
while [ ! -f $PIDFILE ]; do
sleep 0.1
done
if [ $? -eq 0 ]; then
echo "Redis server started successfully."
export REDIS_URL="unix://$SOCKET"
else
echo "Failed to start Redis server. Check logs or permissions."
exit 1
fi
export REDIS_URL="unix://$SOCKET"
if [ ! -f "$PIDFILE" ]; then
echo "Redis PID file not found. Starting failed?"
exit 1
fi
pushtrap "kill -9 $(cat $PIDFILE);rm -rf $TMP" EXIT
pushtrap "if [ -f $PIDFILE ]; then kill -9 $(cat $PIDFILE); fi; rm -rf $TMP" EXIT
'';
}

0 comments on commit 6a870a4

Please sign in to comment.