Merge lp:~nuclearbob/qlbr/rtm-cache-clear into lp:~canonical-platform-qa/qlbr/rtm-reports

Proposed by Max Brustkern
Status: Merged
Approved by: Allan LeSage
Approved revision: 126
Merged at revision: 126
Proposed branch: lp:~nuclearbob/qlbr/rtm-cache-clear
Merge into: lp:~canonical-platform-qa/qlbr/rtm-reports
Diff against target: 16 lines (+2/-0)
1 file modified
qlbr/management/commands/get_task_data.py (+2/-0)
To merge this branch: bzr merge lp:~nuclearbob/qlbr/rtm-cache-clear
Reviewer Review Type Date Requested Status
Allan LeSage (community) Approve
Review via email: mp+237095@code.launchpad.net

Description of the change

This branch clears the django cache when a data download is finished.

To post a comment you must log in.
Revision history for this message
Max Brustkern (nuclearbob) wrote :

I also added a command to clear the cache for use when updates occur in the charm.

Revision history for this message
Allan LeSage (allanlesage) wrote :

Forgive me but aren't these some relevant settings to set up this caching system before being able to clear anything?

review: Needs Information
Revision history for this message
Max Brustkern (nuclearbob) wrote :

Yep, we've already got those here:
http://bazaar.launchpad.net/~canonical-platform-qa/qlbr/rtm-reports/view/head:/qlbr/settings.py#L194

At some point I'd like to clean this up and get it back into the main branch, and as part of that, I think I'd like to move to using a dummy cache by default so that installations (i.e. via the charm) can add their own, but right now I don't want to mess with that so we can keep the same code on the instance. Hopefully the instance will be replaced soon.

Revision history for this message
Allan LeSage (allanlesage) wrote :

Thanks Max, I missed the merge-into bit above, I can see how this would be necessary, LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qlbr/management/commands/get_task_data.py'
2--- qlbr/management/commands/get_task_data.py 2014-09-25 19:57:35 +0000
3+++ qlbr/management/commands/get_task_data.py 2014-10-03 15:47:53 +0000
4@@ -19,6 +19,7 @@
5 import logging
6 from optparse import make_option
7
8+from django.core.cache import cache
9 from django.core.exceptions import ObjectDoesNotExist
10 from django.core.management.base import BaseCommand
11
12@@ -238,3 +239,4 @@
13 'QA Reports', 'production', CACHEDIR,
14 credentials_file=options['credentials_file'])
15 self.search_tasks()
16+ cache.clear()

Subscribers

People subscribed via source and target branches