소스 검색

上线 redis 中间件 , pipeline中添加 redis mq 过滤

罗俊辉 1 년 전
부모
커밋
0dd932f4a7
2개의 변경된 파일1개의 추가작업 그리고 12개의 파일을 삭제
  1. 0 11
      application/common/redis/pyredis.py
  2. 1 1
      application/pipeline/pipeline.py

+ 0 - 11
application/common/redis/pyredis.py

@@ -55,14 +55,3 @@ class RedisClient(object):
         """
         self.pool.delete(key)
 
-
-if __name__ == '__main__':
-    R = RedisClient()
-    if R.connect():
-        print(R.select(1))
-        R.insert(1, 2, 3)
-        print(R.select(1))
-        time.sleep(2)
-        print(R.select(1))
-        time.sleep(2)
-        print(R.select(1))

+ 1 - 1
application/pipeline/pipeline.py

@@ -169,7 +169,7 @@ class PiaoQuanPipeline(object):
         """
         if self.red.connect():
             index_txt = "{}-{}".format(self.platform, self.item['video_id'])
-            index_md5 = hashlib.md5(index_txt.encode())
+            index_md5 = hashlib.md5(index_txt.encode()).hexdigest()
             if self.red.select(index_md5):
                 self.aliyun_log.logging(
                     code="2007",