Skip to content

Commit

Permalink
build: hardcode WORKER_COUNT=1 for odk-central start
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Oct 20, 2023
1 parent 2b7c3b9 commit 79b2d26
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions odkcentral/api/init-user-and-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,7 @@ echo "${SYSADMIN_PASSWD}" | odk-cmd --email "${SYSADMIN_EMAIL}" user-create || t
echo "Elevating user to admin"
odk-cmd --email "${SYSADMIN_EMAIL}" user-promote || true

### Run server (copied from start-odk.sh) ###
MEMTOT=$(vmstat -s | grep 'total memory' | awk '{ print $1 }')
if [ "$MEMTOT" -gt "1100000" ]
then
export WORKER_COUNT=4
else
export WORKER_COUNT=1
fi
echo "using $WORKER_COUNT worker(s) based on available memory ($MEMTOT).."

### Run server (hardcode WORKER_COUNT=1 for dev) ###
export WORKER_COUNT=1
echo "Starting server."
exec npx pm2-runtime ./pm2.config.js

0 comments on commit 79b2d26

Please sign in to comment.