From 54dccb20babd2679934c264285d950c0f294f39a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 18 Oct 2016 12:23:27 +0200 Subject: [PATCH] Prevent caching issue when refreshing shot info from Attract --- blender_cloud/attract/__init__.py | 3 ++- blender_cloud/pillar.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/blender_cloud/attract/__init__.py b/blender_cloud/attract/__init__.py index 073603e..f8a141d 100644 --- a/blender_cloud/attract/__init__.py +++ b/blender_cloud/attract/__init__.py @@ -215,7 +215,7 @@ class AttractOperatorMixin: from .. import pillar try: - node = pillar.sync_call(Node.find, atc_object_id) + node = pillar.sync_call(Node.find, atc_object_id, caching=False) except (sdk_exceptions.ResourceNotFound, sdk_exceptions.MethodNotAllowed): self.report({'ERROR'}, 'Shot %r not found on the Attract server, unable to relink.' % atc_object_id) @@ -257,6 +257,7 @@ class AttractShotSubmitNew(AttractOperatorMixin, Operator): class AttractShotFetchUpdate(AttractOperatorMixin, Operator): bl_idname = "attract.shot_fetch_update" bl_label = "Fetch update from Attract" + bl_description = 'Update status, description & notes from Attract' @classmethod def poll(cls, context): diff --git a/blender_cloud/pillar.py b/blender_cloud/pillar.py index dd17958..01ac390 100644 --- a/blender_cloud/pillar.py +++ b/blender_cloud/pillar.py @@ -218,10 +218,10 @@ async def pillar_call(pillar_func, *args, caching=True, **kwargs): return await loop.run_in_executor(None, partial) -def sync_call(pillar_func, *args, **kwargs): +def sync_call(pillar_func, *args, caching=True, **kwargs): """Synchronous call to Pillar, ensures the correct Api object is used.""" - return pillar_func(*args, api=pillar_api(), **kwargs) + return pillar_func(*args, api=pillar_api(caching=caching), **kwargs) async def check_pillar_credentials(required_roles: set):