Files
enteletaor/enteletaor_lib/modules/tasks/proc_remove.py
cr0hn 556d9c5873 fix: many improvements for Python 2 compatibility
fix: removed unused code
fix: removed un used fiels
fix: improvements in Redis dump keys
add: Changed 'proc' module for 'tasks'
2016-02-27 18:50:39 +01:00

27 lines
584 B
Python

# -*- 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)