def flush_user_factor(redis_db): key_pattern = '/alg/math/user_factor/*' keys = redis_scan(redis_db, key_pattern) pipe = redis_db.pipeline() for key in keys: pipe.delete(key) pipe.execute()
def flush_user_factor(self): key_pattern = '/alg/%s/user_factor/*' % self.subject_name keys = redis_scan(redis_db, key_pattern) pipe = self.redis_db.pipeline() for key in keys: pipe.delete(key) pipe.execute()