forked from 0x2620/pandora
migrate from BROKER_URL to CELERY_BROKER_URL
This commit is contained in:
parent
68b56f0c9e
commit
2c41b17bc4
5 changed files with 21 additions and 14 deletions
|
@ -24,7 +24,7 @@ DATABASES = {
|
||||||
'PORT': 5432,
|
'PORT': 5432,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BROKER_URL = "amqp://{0}:{1}@rabbitmq:5672//".format(os.environ.get('RABBITMQ_DEFAULT_USER'), os.environ.get('RABBITMQ_DEFAULT_PASS'))
|
CELERY_BROKER_URL = "amqp://{0}:{1}@rabbitmq:5672//".format(os.environ.get('RABBITMQ_DEFAULT_USER'), os.environ.get('RABBITMQ_DEFAULT_PASS'))
|
||||||
XACCELREDIRECT = True
|
XACCELREDIRECT = True
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
|
|
|
@ -200,7 +200,7 @@ CELERY_TASK_SERIALIZER = 'json'
|
||||||
CELERY_RESULT_SERIALIZER = 'json'
|
CELERY_RESULT_SERIALIZER = 'json'
|
||||||
CELERY_ACCEPT_CONTENT = ['json']
|
CELERY_ACCEPT_CONTENT = ['json']
|
||||||
|
|
||||||
BROKER_URL = 'amqp://pandora:box@localhost:5672//pandora'
|
CELERY_BROKER_URL = 'amqp://pandora:box@localhost:5672//pandora'
|
||||||
|
|
||||||
SEND_CELERY_ERROR_EMAILS = False
|
SEND_CELERY_ERROR_EMAILS = False
|
||||||
|
|
||||||
|
@ -262,6 +262,10 @@ COLLECTION_ICON = join(SCRIPT_ROOT, 'list_icon.py')
|
||||||
|
|
||||||
DB_GIN_TRGM = False
|
DB_GIN_TRGM = False
|
||||||
|
|
||||||
|
ALLOWED_HOSTS = ['*']
|
||||||
|
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||||
|
|
||||||
|
DATA_UPLOAD_MAX_MEMORY_SIZE = 32 * 1024 * 1024
|
||||||
|
|
||||||
RELOADER_RUNNING = False
|
RELOADER_RUNNING = False
|
||||||
#you can ignore things below this line
|
#you can ignore things below this line
|
||||||
|
@ -293,12 +297,4 @@ except NameError:
|
||||||
|
|
||||||
INSTALLED_APPS = tuple(list(INSTALLED_APPS) + LOCAL_APPS)
|
INSTALLED_APPS = tuple(list(INSTALLED_APPS) + LOCAL_APPS)
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['*']
|
|
||||||
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
|
||||||
|
|
||||||
DATA_UPLOAD_MAX_MEMORY_SIZE = 32 * 1024 * 1024
|
|
||||||
try:
|
|
||||||
CELERY_BROKER_URL
|
|
||||||
except NameError:
|
|
||||||
CELERY_BROKER_URL = BROKER_URL
|
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ class Worker(ConsumerMixin):
|
||||||
message.ack()
|
message.ack()
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
with Connection(settings.BROKER_URL) as conn:
|
with Connection(settings.CELERY_BROKER_URL) as conn:
|
||||||
try:
|
try:
|
||||||
worker = Worker(conn)
|
worker = Worker(conn)
|
||||||
worker.run()
|
worker.run()
|
||||||
|
|
11
update.py
11
update.py
|
@ -261,6 +261,17 @@ if __name__ == "__main__":
|
||||||
run('./pandora/manage.py', 'createcachetable')
|
run('./pandora/manage.py', 'createcachetable')
|
||||||
if old <= 6108:
|
if old <= 6108:
|
||||||
run('./bin/pip', 'install', '-r', 'requirements.txt')
|
run('./bin/pip', 'install', '-r', 'requirements.txt')
|
||||||
|
if old <= 6160:
|
||||||
|
run('./bin/pip', 'install', '-r', 'requirements.txt')
|
||||||
|
with open('pandora/local_settings.py', 'r') as f:
|
||||||
|
local_settings = f.read()
|
||||||
|
if 'BROKER_URL' in local_settings and 'CELERY_BROKER_URL' not in local_settings:
|
||||||
|
local_settings = [
|
||||||
|
'CELERY_' + l if l.startswith('BROKER_URL') else l
|
||||||
|
for l in local_settings.split('\n')
|
||||||
|
]
|
||||||
|
with open('pandora/local_settings.py', 'w') as f:
|
||||||
|
f.write('\n'.join(local_settings))
|
||||||
else:
|
else:
|
||||||
if len(sys.argv) == 1:
|
if len(sys.argv) == 1:
|
||||||
branch = get_branch()
|
branch = get_branch()
|
||||||
|
|
|
@ -117,9 +117,9 @@ if [ "$RABBITMQ" == "local" ]; then
|
||||||
rabbitmqctl add_user pandora $RABBITPWD
|
rabbitmqctl add_user pandora $RABBITPWD
|
||||||
rabbitmqctl add_vhost /pandora
|
rabbitmqctl add_vhost /pandora
|
||||||
rabbitmqctl set_permissions -p /pandora pandora ".*" ".*" ".*"
|
rabbitmqctl set_permissions -p /pandora pandora ".*" ".*" ".*"
|
||||||
BROKER_URL="amqp://pandora:$RABBITPWD@localhost:5672//pandora"
|
CELERY_BROKER_URL="amqp://pandora:$RABBITPWD@localhost:5672//pandora"
|
||||||
else
|
else
|
||||||
BROKER_URL="$RABBITMQ"
|
CELERY_BROKER_URL="$RABBITMQ"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# checkout pandora from git
|
# checkout pandora from git
|
||||||
|
@ -145,7 +145,7 @@ DATABASES = {
|
||||||
'PASSWORD': '',
|
'PASSWORD': '',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BROKER_URL = '$BROKER_URL'
|
CELERY_BROKER_URL = '$CELERY_BROKER_URL'
|
||||||
XACCELREDIRECT = True
|
XACCELREDIRECT = True
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
|
|
Loading…
Reference in a new issue