original_docstring: Update this Keeper to use a new config.
docstring: Update this Keeper to use a new config.
docstring_tokens: Update this Keeper to use a new config .
code: def update_config(self, config):
          """Update this Keeper to use a new config."""
          self.config = config
  
          # this method can be indirectly called by _lockdown. it edits the config
          # which in turn makes the Gatekeeper cog call this method. so, we need
          # to make sure that our ratelimits don't reset!
          #
          # the special _update_ratelimiter doesn't reset ratelimits if the new
          # config doesn't change that ratelimit.
  
          self._update_ratelimiter(config.get("ban_threshold"), "unique_join_ratelimiter")
  
          def remove_unneeded_joins(old, new):
              if old is None:
                  # join_ratelimiter is being created for the first time
                  return
  
              if new.rate < old.rate:
                  num_outside = old.rate - new.rate
                  self.log.debug(
                      "update_config: removing %d outside tracked joins", num_outside
                  )
                  del self.recent_joins[:num_outside]
  
          auto_lockdown = config.get("auto_lockdown", {})
          auto_lockdown_threshold = auto_lockdown.get("threshold")
  
          self._update_ratelimiter(
              auto_lockdown_threshold,
              "join_ratelimiter",
              after_update=remove_unneeded_joins,
          )
code_tokens: def update_config ( self , config ) : self . config = config self . _update_ratelimiter ( config . get ( "ban_threshold" ) , "unique_join_ratelimiter" ) def remove_unneeded_joins ( old , new ) : if old is None : return if new . rate < old . rate : num_outside = old . rate - new . rate self . log . debug ( "update_config: removing %d outside tracked joins" , num_outside ) del self . recent_joins [ : num_outside ] auto_lockdown = config . get ( "auto_lockdown" , { } ) auto_lockdown_threshold = auto_lockdown . get ( "threshold" ) self . _update_ratelimiter ( auto_lockdown_threshold , "join_ratelimiter" , after_update = remove_unneeded_joins , )
short_docstring: Update this Keeper to use a new config.
short_docstring_tokens: Update this Keeper to use a new config .
comment: """Update this Keeper to use a new config."""$SEP$# this method can be indirectly called by _lockdown. it edits the config$SEP$# which in turn makes the Gatekeeper cog call this method. so, we need$SEP$# to make sure that our ratelimits don't reset!$SEP$#$SEP$# the special _update_ratelimiter doesn't reset ratelimits if the new$SEP$# config doesn't change that ratelimit.$SEP$# join_ratelimiter is being created for the first time