add: process injection features

add: remove remote processes
fix: minor fixes and reformats
This commit is contained in:
cr0hn
2016-02-19 01:40:54 +01:00
parent d8ce0c9c07
commit 1dd70221c8
7 changed files with 437 additions and 368 deletions

View File

@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
import logging
from kombu import Connection
from .utils import get_remote_messages
log = logging.getLogger()
# ----------------------------------------------------------------------
def action_proc_remove(config):
log.warning(" - Trying to connect with server...")
url = '%s://%s' % (config.broker_type, config.target)
with Connection(url) as conn:
in_queue = conn.SimpleQueue('celery')
# Get remote process
for _ in get_remote_messages(config, in_queue, False):
pass
log.error(" - All processes removed from '%s'" % config.target)