From eb77461ca0eff0fa728caa8b932050581640042c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 17 Jun 2016 16:21:19 +0200 Subject: [PATCH] Removed more caching + added explanation why caching is dangerous here. --- blender_cloud/settings_sync.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/blender_cloud/settings_sync.py b/blender_cloud/settings_sync.py index 290e195..47580f0 100644 --- a/blender_cloud/settings_sync.py +++ b/blender_cloud/settings_sync.py @@ -1,5 +1,10 @@ -"""Synchronizes settings & startup file with the Cloud.""" -import asyncio +"""Synchronises settings & startup file with the Cloud. + +Caching is disabled on many PillarSDK calls, as synchronisation can happen +rapidly between multiple machines. This means that information can be outdated +in seconds, rather than the minutes the cache system assumes. +""" + import logging import pathlib import tempfile @@ -10,7 +15,7 @@ import bpy import pillarsdk from pillarsdk import exceptions as sdk_exceptions from .pillar import pillar_call -from . import async_loop, pillar +from . import async_loop, pillar, cache SETTINGS_FILES_TO_UPLOAD = ['bookmarks.txt', 'recent-files.txt', 'userpref.blend', 'startup.blend'] @@ -192,7 +197,7 @@ class PILLAR_OT_sync(async_loop.AsyncModalOperatorMixin, bpy.types.Operator): node = await pillar_call(pillarsdk.Node.find_first, { 'where': node_props, 'projection': {'_id': 1, 'properties.file': 1} - }) + }, caching=False) if node is None: self.report({'WARNING'}, 'Unable to find %s on Blender Cloud' % fname) self.log.warning('Unable to find node on Blender Cloud for %s', fname)