newtw2
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import asyncio
|
||||
import hashlib
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
@@ -51,8 +52,6 @@ class QingjianAPIClient:
|
||||
if not customer_id:
|
||||
return self.worker_id == 0
|
||||
|
||||
import hashlib
|
||||
# 使用稳定的哈希算法分配客户
|
||||
hash_val = int(hashlib.md5(str(customer_id).encode("utf-8")).hexdigest(), 16)
|
||||
return (hash_val % self.worker_count) == self.worker_id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user