def listen_for_halt(): name = 'Halt_Listener' setproctitle(name) connection.client_setname(name) pubsub = connection.pubsub() pubsub.subscribe('control') for message in pubsub.listen(): if message['type'] == 'message': message_lookup[message['data']]()
def wrapped(): worker = WorkerClass() worker_identifier = '%s:%s:%s' % ( socket.gethostname(), worker.__class__.__name__, os.getpid()) setproctitle(worker_identifier) connection.client_setname(worker_identifier) log.info('Started worker: %s' % worker_identifier) for job in worker: if job: log.debug('Completed job: %s', repr(job)[:50])
# Django settings for caravan project. import os import sys from tasa.store import connection connection.client_setname('Caravan') from caravan import exceptions DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', '*****@*****.**'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'data.db', # Or path to database file if using sqlite3. # The following settings are not used with sqlite3: 'USER': '', 'PASSWORD': '', 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. 'PORT': '', # Set to empty string for default. } } # Hosts/domain names that are valid for this site; required if DEBUG is False