summaryrefslogtreecommitdiff
path: root/meetingtools/apps
diff options
context:
space:
mode:
authorJohan Lundberg <lundberg@nordu.net>2014-04-11 16:36:10 +0200
committerJohan Lundberg <lundberg@nordu.net>2014-04-11 16:36:10 +0200
commit781fadc82dd5f25ef30d99ddd1b01d1b3256b415 (patch)
tree72da190bd71433c7d41813567f02053f3b4664df /meetingtools/apps
parentc3eb142a7bd865fe3db74849e5ca949258459a00 (diff)
Changed caching from 15 minutes to 1h.
Diffstat (limited to 'meetingtools/apps')
-rw-r--r--meetingtools/apps/content/tasks.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/meetingtools/apps/content/tasks.py b/meetingtools/apps/content/tasks.py
index 3de9112..dd9c2ee 100644
--- a/meetingtools/apps/content/tasks.py
+++ b/meetingtools/apps/content/tasks.py
@@ -22,13 +22,13 @@ def import_all_content():
import_acc(acc, since=900)
-@periodic_task(run_every=crontab(hour="*", minute="*/15", day_of_week="*"))
+@periodic_task(run_every=crontab(hour="*", minute="5", day_of_week="*"))
def cache_cluster_content():
for acc in ACCluster.objects.all():
get_cluster_content(acc)
-@periodic_task(run_every=crontab(hour="*", minute="*/15", day_of_week="*"))
+@periodic_task(run_every=crontab(hour="*", minute="10", day_of_week="*"))
def cache_domain_content():
for domain_tag in Tag.objects.filter(name__startswith='domain:'):
get_domain_content(domain_tag)
@@ -65,8 +65,8 @@ def get_cluster_content(acc):
}
total_bytecount += d['domain_bytes']
domains.append(d)
- cache.set('%s-domains' % acc, domains, 900)
- cache.set('%s-bytecount' % acc, total_bytecount, 900)
+ cache.set('%s-domains' % acc, domains, 3600)
+ cache.set('%s-bytecount' % acc, total_bytecount, 3600)
return domains, total_bytecount
@@ -84,9 +84,9 @@ def get_domain_content(domain_tag):
'bytecount': Content.objects.filter(creator=domain_user).aggregate(Sum('bytecount'))['bytecount__sum']
}
users.append(d)
- cache.set('%s-users' % domain_tag, users, 900)
- cache.set('%s-files' % domain_tag, total_files, 900)
- cache.set('%s-bytecount' % domain_tag, total_bytecount, 900)
+ cache.set('%s-users' % domain_tag, users, 3600)
+ cache.set('%s-files' % domain_tag, total_files, 3600)
+ cache.set('%s-bytecount' % domain_tag, total_bytecount, 3600)
return users, total_files, total_bytecount