Commit f0318ca7 by Őry Máté

one: periodical update of statistics

parent 7958942b
......@@ -7,8 +7,7 @@ def process_debug(req):
return {'DEBUG': DEBUG}
def process_stat(req):
# stat = cache.get('cloud_stat');
stat = json.loads(subprocess.check_output(['/opt/webadmin/cloud/miscellaneous/stat/stat_wrap.sh']))
stat = cache.get('cloud_stat')
return {
'STAT_DEBUG': STAT_DEBUG,
'cloud_stat': stat,
......
......@@ -205,6 +205,14 @@ CELERY_ROUTES = {
'one.tasks.SendMailTask': {'queue': 'local'},
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
store_settings = {
"basic_auth": "True",
"verify_ssl": "False",
......
......@@ -6,12 +6,13 @@ do
sudo stop $i || true
done
sudo apt-get install rabbitmq-server gettext
sudo apt-get install rabbitmq-server gettext memcached
sudo rabbitmqctl delete_user guest || true
sudo rabbitmqctl add_user nyuszi teszt || true
sudo rabbitmqctl add_vhost django || true
sudo rabbitmqctl set_permissions -p django nyuszi '.*' '.*' '.*' || true
sudo pip install python-memcached
sudo cp /opt/webadmin/cloud/miscellaneous/devenv/boot_url.py /opt/
......
from one.models import *
from django_extensions.management.jobs import QuarterHourlyJob
from django.core.cache import cache
import json
class Job(QuarterHourlyJob):
help = "Update statistics from OpenNebula."
def execute(self):
stat = json.loads(subprocess.check_output(['/opt/webadmin/cloud/miscellaneous/stat/stat_wrap.sh']))
cache.set('cloud_stat', stat)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment