From e5aa569d475347e89636f6bf677d40df4455d027 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Tue, 19 May 2015 16:10:19 +0100 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/widgets.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/toaster/toastergui/widgets.py') 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): for key, val in request.GET.iteritems(): cache_name = cache_name + str(key) + str(val) + for key, val in kwargs.iteritems(): + cache_name = cache_name + str(key) + str(val) + data = cache.get(cache_name) if data: @@ -306,8 +309,7 @@ class ToasterTable(View): except FieldError: print "Error: Requested field does not exist" - data = json.dumps(data, indent=2, cls=DjangoJSONEncoder) - cache.set(cache_name, data, 10) + cache.set(cache_name, data, 60*30) return data -- cgit v1.2.3-54-g00ecf