Skip to content

Commit

Permalink
Add NFT_JAVA_ARGS environment variable support for custom JVM optio…
Browse files Browse the repository at this point in the history
…ns (#264)

* Fix wrong java command

* Add env variable to set java arguments
  • Loading branch information
lukfor authored Oct 9, 2024
1 parent d364796 commit 67db3aa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion files/nf-test
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,17 @@ else
FILE_PATH_JAR=${APP_HOME}/${APP_JAR}
fi

JAVA_ARGS="-Xmx10G"
if [[ "$NFT_JAVA_ARGS" ]]; then
JAVA_ARGS="$NFT_JAVA_ARGS"
fi

export JAVA_PROGRAM_ARGS=`echo "$@"`

if [ "${JAVA_PROGRAM_ARGS}" = "update" ]; then
echo "Updating application..."
cd "${FOLDER}"
update
else
java -Xmx10G -jar "${FILE_PATH_JAR}" "$@"
exec ${JAVA_CMD} ${JAVA_ARGS} -jar "${FILE_PATH_JAR}" "$@"
fi

0 comments on commit 67db3aa

Please sign in to comment.