diff --git a/api/db/providerkeys.py b/api/db/providerkeys.py index a75b95f..4902d80 100644 --- a/api/db/providerkeys.py +++ b/api/db/providerkeys.py @@ -65,7 +65,7 @@ class KeyManager: for filename in await aiofiles.os.listdir(os.path.join('api', 'secret')): if filename.endswith('.txt'): async with aiofiles.open(os.path.join('api', 'secret', 'filename')) as f: - for line in await f.readlines(): + async for line in f: if not line.strip(): continue diff --git a/api/providers/__main__.py b/api/providers/__main__.py index f61bb47..71b586f 100644 --- a/api/providers/__main__.py +++ b/api/providers/__main__.py @@ -5,9 +5,7 @@ from rich import print def remove_duplicate_keys(file): with open(file, 'r', encoding='utf8') as f: - lines = f.readlines() - - unique_lines = set(lines) + unique_lines = set(f) with open(file, 'w', encoding='utf8') as f: f.writelines(unique_lines)