Skip to content

Commit 3406692

Browse files
committed
[core] run xvfb only for WEBJS engine
1 parent 901c594 commit 3406692

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

entrypoint.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,23 @@ if [ -n "$key" ]; then
4343
fi
4444

4545
#
46-
# Check if xvfb-run works and set up virtual display
46+
# xvfb-run
4747
#
48-
# Try to run xvfb-run with a test command
49-
if xvfb-run --auto-servernum echo "xvfb-run is working!"; then
50-
USE_XVFB_RUN=true
51-
else
52-
echo "xvfb-run test failed, falling back to manual Xvfb setup"
53-
USE_XVFB_RUN=false
48+
USE_XVFB=false
49+
if [ -z "$WHATSAPP_DEFAULT_ENGINE" ] || [ "$WHATSAPP_DEFAULT_ENGINE" = "WEBJS" ]; then
50+
# Try to run xvfb-run with a test command
51+
if xvfb-run --auto-servernum echo "xvfb-run is working!"; then
52+
USE_XVFB=true
53+
else
54+
echo "xvfb-run test failed, do not run it"
55+
USE_XVFB=false
56+
fi
5457
fi
5558

5659
#
5760
# Start your application using node with exec to ensure proper signal handling
5861
#
59-
if [ "$USE_XVFB_RUN" = "true" ]; then
62+
if [ "$USE_XVFB" = "true" ]; then
6063
exec xvfb-run --auto-servernum node dist/main
6164
else
6265
exec node dist/main

0 commit comments

Comments
 (0)