sfmc.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:basket 作者: mozmeao 项目源码 文件源码
def refresh_auth_tokens_from_cache(self):
        """Refresh the auth token and other values from cache"""
        if self.authToken is not None and time() + MAX_BUFFER < self.authTokenExpiration:
            # no need to refresh if the current tokens are still good
            return

        tokens = cache.get(self.token_cache_key)
        if tokens:
            if not isinstance(tokens, dict):
                # something wrong was cached
                cache.delete(self.token_cache_key)
                return

            for prop, value in tokens.items():
                if prop in self.token_property_names:
                    setattr(self, prop, value)

            # set the value so we can detect if it changed later
            self._old_authToken = self.authToken
            self.build_soap_client()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号