Refa:replace trio with asyncio (#11831)

### What problem does this PR solve?

change:
replace trio with asyncio

### Type of change
- [x] Refactoring
This commit is contained in:
buua436
2025-12-09 19:23:14 +08:00
committed by GitHub
parent ca2d6f3301
commit 65a5a56d95
31 changed files with 821 additions and 429 deletions

View File

@ -14,6 +14,7 @@
# limitations under the License.
#
import asyncio
import logging
import json
import uuid
@ -22,7 +23,6 @@ import valkey as redis
from common.decorator import singleton
from common import settings
from valkey.lock import Lock
import trio
REDIS = {}
try:
@ -405,7 +405,7 @@ class RedisDistributedLock:
while True:
if self.lock.acquire(token=self.lock_value):
break
await trio.sleep(10)
await asyncio.sleep(10)
def release(self):
REDIS_CONN.delete_if_equal(self.lock_key, self.lock_value)