Procházet zdrojové kódy

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

罗俊辉 před 1 rokem
rodič
revize
0dd932f4a7

+ 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",