diff --git a/brokersettings.py.example b/brokersettings.py.example index 192d7c8..51c917a 100644 --- a/brokersettings.py.example +++ b/brokersettings.py.example @@ -1,5 +1,5 @@ BROKER_HOST = "localhost" -BROKER_PORT = 5673 +BROKER_PORT = 5672 BROKER_USER = "%(user)s" BROKER_PASSWORD = "%(password)s" BROKER_VHOST = "%(vhost)s" diff --git a/eve_api/tasks.py b/eve_api/tasks.py index 0367487..e65a911 100644 --- a/eve_api/tasks.py +++ b/eve_api/tasks.py @@ -60,7 +60,7 @@ def import_apikey(api_userid, api_key, user=None, force_cache=False): return acc -@task(ignore_result=True, rate_limit='10/d') +@task(ignore_result=True, rate_limit='1/h') def import_alliance_details(): from eve_api.api_puller.alliances import __start_full_import as alliance_import alliance_import() diff --git a/fabfile.py b/fabfile.py index 7d3b88e..444e7dd 100644 --- a/fabfile.py +++ b/fabfile.py @@ -77,17 +77,27 @@ def setup_db(): run('if [ ! -e dbsettings.py ]; then cp dbsettings.py.example dbsettings.py; fi' % env) run('env/bin/python manage.py syncdb --noinput --migrate') -def setup_rabbitmq(): - """ - Setup the RabbitMQ instance on the system (requires sudo access) +def generate_brokersettings(): + """ + Generates the brokersettings file """ - require('path') + require('hosts') cnf = open('brokersettings.py.example', 'r').read() out = open('brokersettings.py', 'w') out.write(cnf % env) +def setup_rabbitmq(): + """ + Setup the RabbitMQ instance on the system (requires sudo access) + """ + + require('hosts') + require('path') + + generate_brokersettings() + sudo('rabbitmqctl add_user %s %s' % (env.user, env.password), shell=False) sudo('rabbitmqctl add_vhost %s' % env.vhost, shell=False) sudo('rabbitmqctl set_permissions -p %s %s ".*" ".*" ".*"' % (env.vhost, env.user), shell=False)