瀏覽代碼

上线 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",