mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-11 23:18:22 +08:00
Fix: Minor issues when running Alas on AidLux+VMOS
- Rename function names in research_optimizer to avoid tests - Remove watch_memory decorator and psutil dependency - Fix typo of Hermit
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import re
|
||||
|
||||
import gc
|
||||
import psutil
|
||||
|
||||
from module.base.decorator import cached_property
|
||||
from module.logger import logger
|
||||
@@ -19,22 +18,6 @@ def del_cached_property(obj, name):
|
||||
del obj.__dict__[name]
|
||||
|
||||
|
||||
def watch_memory(func):
|
||||
"""
|
||||
Show memory changes in log
|
||||
release_resources: 181.555MB -> 163.066MB
|
||||
"""
|
||||
|
||||
def wrapper(*args, **kwargs):
|
||||
before = psutil.Process().memory_info().rss / (1024 * 1024)
|
||||
result = func(*args, **kwargs)
|
||||
after = psutil.Process().memory_info().rss / (1024 * 1024)
|
||||
logger.info(f'{func.__name__}: {round(before, 3)}MB -> {round(after, 3)}MB')
|
||||
return result
|
||||
|
||||
return wrapper
|
||||
|
||||
|
||||
def get_assets_from_file(file, regex):
|
||||
assets = set()
|
||||
with open(file, 'r', encoding='utf-8') as f:
|
||||
|
||||
Reference in New Issue
Block a user