From b56dcaac68b6937c07f01c13aab8a315a07fc191 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Sun, 3 Sep 2017 18:21:13 -0700 Subject: [PATCH] Only run scheduler when app is healthy Fixes #393 --- src/scheduler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scheduler.js b/src/scheduler.js index c178b9b7b..1c045d02e 100644 --- a/src/scheduler.js +++ b/src/scheduler.js @@ -145,8 +145,8 @@ function doTask(appId, taskName, callback) { apps.get(appId, function (error, app) { if (error) return callback(error); - if (app.installationState !== appdb.ISTATE_INSTALLED || app.runState !== appdb.RSTATE_RUNNING) { - debug('task %s skipped. app %s is not installed/running', taskName, app.id); + if (app.installationState !== appdb.ISTATE_INSTALLED || app.runState !== appdb.RSTATE_RUNNING || app.health !== appdb.HEALTH_HEALTHY) { + debug('task %s skipped. app %s is not installed/running/healthy', taskName, app.id); return callback(); }