mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-16 06:25:24 +00:00
Fix: [ALAS] Limit the length of screenshot deque
This commit is contained in:
parent
85ce412fb5
commit
21a8e276b6
@ -98,7 +98,14 @@ class Screenshot(Adb, WSA, DroidCast, AScreenCap, Scrcpy):
|
||||
|
||||
@cached_property
|
||||
def screenshot_deque(self):
|
||||
return deque(maxlen=int(self.config.Error_ScreenshotLength))
|
||||
try:
|
||||
length = int(self.config.Error_ScreenshotLength)
|
||||
except ValueError:
|
||||
logger.error(f'Error_ScreenshotLength={self.config.Error_ScreenshotLength} is not an integer')
|
||||
raise RequestHumanTakeover
|
||||
# Limit in 1~300
|
||||
length = max(1, min(length, 300))
|
||||
return deque(maxlen=length)
|
||||
|
||||
@cached_property
|
||||
def screenshot_tracking(self):
|
||||
|
Loading…
Reference in New Issue
Block a user