Skip to content

Commit

Permalink
Implement logic to wait for remotes to stop
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Feb 10, 2015
1 parent 2b19311 commit e21dcf7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -5,7 +5,7 @@ ifndef TRAVIS
endif

# Test runner settings
UNIT_TEST_COVERAGE := 87
UNIT_TEST_COVERAGE := 86
INTEGRATION_TEST_COVERAGE := 94

# Project settings
Expand Down
20 changes: 12 additions & 8 deletions mine/cli.py
Expand Up @@ -90,14 +90,18 @@ def run(path=None):
def launch_next(config, status, computer, manager):
"""Launch applications that have been queued."""
log.info("launching queued applications...")
for status in status.applications:
if status.next:
application = config.applications.get(status.application)
log.info("%s queued for: %s", application, status.next)
if status.next == computer:
if not manager.is_running(application):
manager.start(application)
status.next = None
for app_status in status.applications:
if app_status.next:
application = config.applications.get(app_status.application)
log.info("%s queued for: %s", application, app_status.next)
if app_status.next == computer:
latest = status.get_latest(application)
if latest in (computer, None):
if not manager.is_running(application):
manager.start(application)
app_status.next = None
else:
log.info("%s still running on: %s", application, latest)
elif manager.is_running(application):
manager.stop(application)

Expand Down

0 comments on commit e21dcf7

Please sign in to comment.