Skip to content

Commit a340ee0

Browse files
committed
修复提前keepalive问题
1 parent fa72508 commit a340ee0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

core/cluster.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,8 @@ def __init__(
696696
scheduler.repeat(self._keepalive, interval=60)
697697

698698
async def _keepalive(self):
699-
def get_keepalive_file():
699+
async def get_keepalive_file():
700+
await self._wait_lock()
700701
self.keepalive_file = (sorted(filter(lambda x: x.size != 0, list(self.files.values())) or [], key=lambda x: x.size) or [None])[0]
701702
if self.keepalive_file is None:
702703
disable("no_file")
@@ -714,10 +715,10 @@ def disable(reason, *args, **kwargs):
714715
try:
715716
hostname = self.hostname
716717
endpoint = self.endpoint
717-
get_keepalive_file()
718+
await get_keepalive_file()
718719
if not self.keepalive_file:
719720
await self._list_all()
720-
get_keepalive_file()
721+
await get_keepalive_file()
721722
if not self.keepalive_file:
722723
disable("no_file")
723724
return

0 commit comments

Comments
 (0)