Prevent caching issue when refreshing shot info from Attract
This commit is contained in:
parent
61a8db3f96
commit
54dccb20ba
@ -215,7 +215,7 @@ class AttractOperatorMixin:
|
|||||||
from .. import pillar
|
from .. import pillar
|
||||||
|
|
||||||
try:
|
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):
|
except (sdk_exceptions.ResourceNotFound, sdk_exceptions.MethodNotAllowed):
|
||||||
self.report({'ERROR'}, 'Shot %r not found on the Attract server, unable to relink.'
|
self.report({'ERROR'}, 'Shot %r not found on the Attract server, unable to relink.'
|
||||||
% atc_object_id)
|
% atc_object_id)
|
||||||
@ -257,6 +257,7 @@ class AttractShotSubmitNew(AttractOperatorMixin, Operator):
|
|||||||
class AttractShotFetchUpdate(AttractOperatorMixin, Operator):
|
class AttractShotFetchUpdate(AttractOperatorMixin, Operator):
|
||||||
bl_idname = "attract.shot_fetch_update"
|
bl_idname = "attract.shot_fetch_update"
|
||||||
bl_label = "Fetch update from Attract"
|
bl_label = "Fetch update from Attract"
|
||||||
|
bl_description = 'Update status, description & notes from Attract'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
|
@ -218,10 +218,10 @@ async def pillar_call(pillar_func, *args, caching=True, **kwargs):
|
|||||||
return await loop.run_in_executor(None, partial)
|
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."""
|
"""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):
|
async def check_pillar_credentials(required_roles: set):
|
||||||
|
Reference in New Issue
Block a user