diff options
Diffstat (limited to 'python/report_ops/status.py')
| -rw-r--r-- | python/report_ops/status.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/python/report_ops/status.py b/python/report_ops/status.py index 040431ce..2e91adea 100644 --- a/python/report_ops/status.py +++ b/python/report_ops/status.py @@ -58,10 +58,10 @@ class QuantifiRemote( def process(cls, fname): if fname.startswith("kickout"): # We only want to process status messages here return - file_io = BytesIO() - cls._client.client.retrbinary(f"RETR /OUTGOING/status/{fname}", file_io.write) - file_io.seek(0) - parse = ET.parse(file_io) + buf = BytesIO() + cls._client.client.retrbinary(f"RETR /OUTGOING/status/{fname}", buf.write) + buf.seek(0) + parse = ET.parse(buf) data = {key: value for key, value in parse.getroot().items()} data = data | { "uploadtime": cls.extract_ts(fname), @@ -76,8 +76,11 @@ class QuantifiRemote( item._conn.rollback() else: QuantifiMonitor.stage(data) - QuantifiMonitor.email(fname.removesuffix(".xml"), int(data["errors"]) > 0) - QuantifiMonitor().clear() + buf.seek(0) + QuantifiMonitor.email( + fname.removesuffix(".xml"), int(data["errors"]) > 0, buf.getvalue() + ) + QuantifiMonitor._staging_queue.clear() finally: item._insert_queue.clear() |
