fix: unreachable?
This commit is contained in:
@@ -374,19 +374,6 @@ class PFChatting:
|
||||
)
|
||||
action_taken_this_cycle = False
|
||||
|
||||
except Exception as e_cycle:
|
||||
logger.error(f"{log_prefix} 循环周期执行时发生错误: {e_cycle}")
|
||||
logger.error(traceback.format_exc())
|
||||
if acquired_lock and self._processing_lock.locked():
|
||||
self._processing_lock.release()
|
||||
acquired_lock = False
|
||||
logger.warning(f"{log_prefix} 由于循环周期中的错误释放了处理锁.")
|
||||
|
||||
finally:
|
||||
if acquired_lock:
|
||||
self._processing_lock.release()
|
||||
logger.trace(f"{log_prefix} 循环释放了处理锁.")
|
||||
|
||||
# --- Print Timer Results --- #
|
||||
if cycle_timers: # 先检查cycle_timers是否非空
|
||||
timer_strings = []
|
||||
@@ -402,6 +389,20 @@ class PFChatting:
|
||||
|
||||
# --- Timer Decrement --- #
|
||||
cycle_duration = time.monotonic() - loop_cycle_start_time
|
||||
|
||||
except Exception as e_cycle:
|
||||
logger.error(f"{log_prefix} 循环周期执行时发生错误: {e_cycle}")
|
||||
logger.error(traceback.format_exc())
|
||||
if acquired_lock and self._processing_lock.locked():
|
||||
self._processing_lock.release()
|
||||
acquired_lock = False
|
||||
logger.warning(f"{log_prefix} 由于循环周期中的错误释放了处理锁.")
|
||||
|
||||
finally:
|
||||
if acquired_lock:
|
||||
self._processing_lock.release()
|
||||
logger.trace(f"{log_prefix} 循环释放了处理锁.")
|
||||
|
||||
async with self._timer_lock:
|
||||
self._loop_timer -= cycle_duration
|
||||
# Log timer decrement less aggressively
|
||||
|
||||
Reference in New Issue
Block a user