Skip to content

Commit b235fc6

Browse files
committed
fix service checking in Makefile before trying to start server
1 parent fbd7acb commit b235fc6

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ celery-start:
273273

274274
# check that the Celery processes are running
275275
celery-check:
276-
-ps auxww | grep 'celery' | grep -v 'grep' | grep -v 'make' | grep '$(CURDIR)'
276+
ps auxww | grep 'celery' | grep -v 'grep' | grep -v 'make' | grep '$(CURDIR)'
277277

278278
# kill all the Celery processes started from this dir
279279
celery-stop:
@@ -291,11 +291,14 @@ start-services: check-env
291291
$(MAKE) celery-start
292292

293293
stop-services:
294-
$(MAKE) celery-stop
295-
$(MAKE) rabbitmq-stop
296-
$(MAKE) db-stop
297-
294+
-$(MAKE) celery-stop
295+
-$(MAKE) rabbitmq-stop
296+
-$(MAKE) db-stop
298297

298+
check-services:
299+
$(MAKE) celery-check
300+
$(MAKE) db-check
301+
$(MAKE) rabbitmq-check
299302

300303
# ~~~~~ Set Up Django ~~~~~ #
301304
export DJANGO_BEAGLE_IP:=localhost
@@ -340,6 +343,7 @@ test-lims: check-env
340343

341344
# start the Django development server
342345
runserver: check-env
346+
if $(MAKE) check-services ; then : ; else echo ">>> ERROR: some services are not started"; exit 1 ; fi
343347
python manage.py runserver $(DJANGO_BEAGLE_IP):$(DJANGO_BEAGLE_PORT)
344348

345349
MIGRATION_ARGS?=

0 commit comments

Comments
 (0)