parameters: (self, request, view_func, view_args, view_kwargs)
docstring: 处理当前在线人数
docstring_summary: 处理当前在线人数
docstring_tokens: 处理当前在线人数
function: def process_view(self, request, view_func, view_args, view_kwargs):
          """
          处理当前在线人数
          """
          http_user_agent = request.META.get('HTTP_USER_AGENT', [])
          if 'Spider' in http_user_agent or 'spider' in http_user_agent:
              return
  
          online_ips = cache.get("online_ips", [])
  
          if online_ips:
              online_ips = cache.get_many(online_ips).keys()
  
          ip = get_real_ip(request)
  
          cache.set(ip, 0, 5 * 60)
  
          if ip not in online_ips:
              online_ips.append(ip)
  
          cache.set("online_ips", online_ips)
function_tokens: def process_view ( self , request , view_func , view_args , view_kwargs ) : http_user_agent = request . META . get ( 'HTTP_USER_AGENT' , [ ] ) if 'Spider' in http_user_agent or 'spider' in http_user_agent : return online_ips = cache . get ( "online_ips" , [ ] ) if online_ips : online_ips = cache . get_many ( online_ips ) . keys ( ) ip = get_real_ip ( request ) cache . set ( ip , 0 , 5 * 60 ) if ip not in online_ips : online_ips . append ( ip ) cache . set ( "online_ips" , online_ips )