From 6e1b7b6ad8cf859819ef763779b1c274bc63d82d Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 7 Apr 2016 10:55:33 -0500 Subject: [PATCH] Update listend.py fixed quick bug due to double header writes during rotations --- tacc_stats/listend.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tacc_stats/listend.py b/tacc_stats/listend.py index 1fb68b09..641c179a 100755 --- a/tacc_stats/listend.py +++ b/tacc_stats/listend.py @@ -19,8 +19,9 @@ def on_message(channel, method_frame, header_frame, body): with open(current_path, 'w') as fd: link_path = os.path.join(host_dir, str(int(time.time()))) - if not os.path.exists(link_path): - os.link(current_path, link_path) + if os.path.exists(link_path): + os.remove(link_path) + os.link(current_path, link_path) with open(current_path, 'a') as fd: fd.write(body)