diff --git a/bc/channel/models.py b/bc/channel/models.py index ad0caf9c..14913ec3 100644 --- a/bc/channel/models.py +++ b/bc/channel/models.py @@ -21,6 +21,8 @@ logger = logging.getLogger(__name__) +r = make_redis_interface("CACHE") + class Group(AbstractDateTimeModel): name = models.CharField( @@ -166,7 +168,6 @@ def validate_access_token(self): """ if self.service not in self.CHANNELS_TO_REFRESH: return - r = make_redis_interface("CACHE") lock_key = self._get_refresh_lock_key() lock = r.lock(lock_key, sleep=1, timeout=60) blocking_timeout = 60