(self, message, project, log_cap=200)
Log up to `log_cap` messages,
Log up to `log_cap` messages,
Log up to log_cap messages
def log_message(self, message, project, log_cap=200):
        """
        Log up to `log_cap` messages,
        """
        final_message = {
            'msg': message,
            'project_id': project.id,
            'owner_id': project.owner.id
        }
        message_dump = json.dumps(final_message)

        with self.r.pipeline() as pipe:
            pipe.lpush(self.key_recent_messages, message_dump)
            pipe.ltrim(self.key_recent_messages, 0, log_cap)
            pipe.execute()
def log_message ( self , message , project , log_cap = 200 ) : final_message = { 'msg' : message , 'project_id' : project . id , 'owner_id' : project . owner . id } message_dump = json . dumps ( final_message ) with self . r . pipeline ( ) as pipe : pipe . lpush ( self . key_recent_messages , message_dump ) pipe . ltrim ( self . key_recent_messages , 0 , log_cap ) pipe . execute ( )