Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
097fb7ecbb | ||
|
|
167ef235e6 |
No files matched your search
+1
-1
@@ -106,7 +106,7 @@ class LogClient:
|
|||||||
|
|
||||||
while not self._stop.is_set():
|
while not self._stop.is_set():
|
||||||
timeout = self._flush_interval - (time.monotonic() - last_flush)
|
timeout = self._flush_interval - (time.monotonic() - last_flush)
|
||||||
chk_timeout = max(0.0, min(timeout, 0.5))
|
chk_timeout = max(0.1, min(timeout, 0.5))
|
||||||
try:
|
try:
|
||||||
item = self._queue.get(timeout=chk_timeout)
|
item = self._queue.get(timeout=chk_timeout)
|
||||||
batch.append(item)
|
batch.append(item)
|
||||||
|
|||||||
+1
-1
@@ -114,7 +114,7 @@ class LogClient:
|
|||||||
while not self._stop.is_set():
|
while not self._stop.is_set():
|
||||||
timeout = self._flush_interval - (time.monotonic() - last_flush)
|
timeout = self._flush_interval - (time.monotonic() - last_flush)
|
||||||
# 限制最长阻塞时间,以便及时响应 flush() 信号
|
# 限制最长阻塞时间,以便及时响应 flush() 信号
|
||||||
chk_timeout = max(0.0, min(timeout, 0.5))
|
chk_timeout = max(0.1, min(timeout, 0.5))
|
||||||
try:
|
try:
|
||||||
item = self._queue.get(timeout=chk_timeout)
|
item = self._queue.get(timeout=chk_timeout)
|
||||||
batch.append(item)
|
batch.append(item)
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ class LogClient:
|
|||||||
|
|
||||||
while not self._stop.is_set():
|
while not self._stop.is_set():
|
||||||
timeout = self._flush_interval - (time.monotonic() - last_flush)
|
timeout = self._flush_interval - (time.monotonic() - last_flush)
|
||||||
chk_timeout = max(0.0, min(timeout, 0.5))
|
chk_timeout = max(0.1, min(timeout, 0.5))
|
||||||
try:
|
try:
|
||||||
item = self._queue.get(timeout=chk_timeout)
|
item = self._queue.get(timeout=chk_timeout)
|
||||||
batch.append(item)
|
batch.append(item)
|
||||||
|
|||||||
Reference in new issue
Block a user