diff --git a/benchmark.py b/benchmark.py old mode 100755 new mode 100644 index 0f571455e..e969c1f2e --- a/benchmark.py +++ b/benchmark.py @@ -151,12 +151,13 @@ def writeStatus(message, config): if os.path.exists(statusFilename): with open(statusFilename, "r") as statusFile: - content = statusFile.read() + # add the previous status messages, but trancate them + content = statusFile.readlines()[0:(config["storage"]["statusLogSize"] - 1)] else: content = "" with open(statusFilename, "w") as statusFile: - print(time.strftime("%Y-%m-%d %H:%M:%S %z") + "\t" + message + "\n" + content, file = statusFile, end = "") + print(time.strftime("%Y-%m-%d %H:%M:%S %z") + "\t" + message + "\n" + "".join(content), file = statusFile, end = "") git(["add", "status.log"], dataDir) git(["commit", "-m Update status: " + message], dataDir) diff --git a/config.example.yaml b/config.example.yaml index 8ca26eb32..14fadc4d3 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -14,6 +14,8 @@ storage: results: results config: config status: status + # the maximum size of the status log in lines + statusLogSize: 100 executables: timeout: