fix: unused options in redis fix: compatibility between python 2-3 fix: forgot vars declarations fix: carry conditions in listing redis keys fix: listing redis list keys fix: removed duplicated tasks when they are listed fix: index number when redis DB are listed fix: some error levels in log fix: renamed *proc* -> *tasks* files fix: added the process manager backend for 'tasks' options, thinking in future to add new process managers
27 lines
580 B
Python
27 lines
580 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 tasks removed from '%s'" % config.target)
|