优化代码

dependabot/pip/fir_ser/django-3.2.4
youngS 4 years ago
parent 1cc239698b
commit 5bac330551
  1. 2
      fir_ser/api/utils/crontab/ctasks.py
  2. 3
      fir_ser/api/utils/storage/storage.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))

@ -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

Loading…
Cancel
Save