From 5bac33055161de51355f4c402ed4c3f8be4106c9 Mon Sep 17 00:00:00 2001 From: youngS Date: Tue, 8 Jun 2021 16:47:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fir_ser/api/utils/crontab/ctasks.py | 2 +- fir_ser/api/utils/storage/storage.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fir_ser/api/utils/crontab/ctasks.py b/fir_ser/api/utils/crontab/ctasks.py index cb4f028..f6a8f63 100644 --- a/fir_ser/api/utils/crontab/ctasks.py +++ b/fir_ser/api/utils/crontab/ctasks.py @@ -75,4 +75,4 @@ def auto_check_ios_developer_active(): ios_developer.save() logger.error(msg) send_ios_developer_active_status(userinfo, MSGTEMPLATE.get('AUTO_CHECK_DEVELOPER') % ( - userinfo.first_name, ios_developer.name)) + userinfo.first_name, ios_developer.name)) diff --git a/fir_ser/api/utils/storage/storage.py b/fir_ser/api/utils/storage/storage.py index a7bf602..4c10f26 100644 --- a/fir_ser/api/utils/storage/storage.py +++ b/fir_ser/api/utils/storage/storage.py @@ -20,7 +20,8 @@ logger = logging.getLogger(__file__) class Storage(object): def __init__(self, user, storage_obj=None, use_default_storage=False): try: - self.storage = self.get_storage(user, storage_obj, use_default_storage) + with cache.lock("%s_%s" % ('make_storage_cache', user.uid), timeout=10, blocking_timeout=6): + self.storage = self.get_storage(user, storage_obj, use_default_storage) except Exception as e: logger.error("get %s storage failed Exception:%s" % (user, e)) self.storage = None