mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-23 06:46:40 +08:00
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:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user