diff --git a/management/backup.py b/management/backup.py index f352fb41..bb08c13d 100755 --- a/management/backup.py +++ b/management/backup.py @@ -186,7 +186,7 @@ def get_passphrase(env): # length of 32 bytes. backup_root = os.path.join(env["STORAGE_ROOT"], 'backup') with open(os.path.join(backup_root, 'secret_key.txt'), encoding="utf-8") as f: - passphrase = f.readline().strip() + passphrase = f.readline(5_000_000).strip() if len(passphrase) < 43: raise Exception("secret_key.txt's first line is too short!") return passphrase diff --git a/management/mail_log.py b/management/mail_log.py index e127af3b..9f8b176c 100755 --- a/management/mail_log.py +++ b/management/mail_log.py @@ -587,7 +587,7 @@ def readline(filename): """ with open(filename, errors='replace', encoding='utf-8') as file: while True: - line = file.readline() + line = file.readline(5_000_000) if not line: break yield line