summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-05-19 16:10:19 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-29 11:59:45 +0100
commite5aa569d475347e89636f6bf677d40df4455d027 (patch)
tree8ea0b9ca8eb786c0465b89f1f3b2745513bc6cf8 /bitbake/lib/toaster/toastergui
parent2de01a68eb6a9ca74384957c674928944c235269 (diff)
downloadpoky-e5aa569d475347e89636f6bf677d40df4455d027.tar.gz
bitbake: toaster: Add an invalidate cache method on data update signal
Instead of relying on the cache expiring over an amount of time we can listen to the changed notification on the models to invalidate the cache. Also fixes overlapping cache names. (Bitbake rev: eb0b1450e421cf65b407b1ac0336ac24ffc626e8) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui')
-rw-r--r--bitbake/lib/toaster/toastergui/tables.py5
-rw-r--r--bitbake/lib/toaster/toastergui/widgets.py6
2 files changed, 4 insertions, 7 deletions
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py
index 78a7cb095e..9a93ff9aad 100644
--- a/bitbake/lib/toaster/toastergui/tables.py
+++ b/bitbake/lib/toaster/toastergui/tables.py
@@ -323,11 +323,6 @@ class LayerRecipesTable(RecipesTable):
323 323
324 324
325 325
326
327
328
329
330
331# This needs to be staticaly defined here as django reads the url patterns 326# This needs to be staticaly defined here as django reads the url patterns
332# on start up 327# on start up
333urlpatterns = ( 328urlpatterns = (
diff --git a/bitbake/lib/toaster/toastergui/widgets.py b/bitbake/lib/toaster/toastergui/widgets.py
index b5dfbbc039..8cf6e1bc2d 100644
--- a/bitbake/lib/toaster/toastergui/widgets.py
+++ b/bitbake/lib/toaster/toastergui/widgets.py
@@ -245,6 +245,9 @@ class ToasterTable(View):
245 for key, val in request.GET.iteritems(): 245 for key, val in request.GET.iteritems():
246 cache_name = cache_name + str(key) + str(val) 246 cache_name = cache_name + str(key) + str(val)
247 247
248 for key, val in kwargs.iteritems():
249 cache_name = cache_name + str(key) + str(val)
250
248 data = cache.get(cache_name) 251 data = cache.get(cache_name)
249 252
250 if data: 253 if data:
@@ -306,8 +309,7 @@ class ToasterTable(View):
306 except FieldError: 309 except FieldError:
307 print "Error: Requested field does not exist" 310 print "Error: Requested field does not exist"
308 311
309
310 data = json.dumps(data, indent=2, cls=DjangoJSONEncoder) 312 data = json.dumps(data, indent=2, cls=DjangoJSONEncoder)
311 cache.set(cache_name, data, 10) 313 cache.set(cache_name, data, 60*30)
312 314
313 return data 315 return data