aboutsummaryrefslogtreecommitdiffstats
path: root/python/quantifi_status.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/quantifi_status.py')
-rw-r--r--python/quantifi_status.py45
1 files changed, 0 insertions, 45 deletions
diff --git a/python/quantifi_status.py b/python/quantifi_status.py
deleted file mode 100644
index 32aa8267..00000000
--- a/python/quantifi_status.py
+++ /dev/null
@@ -1,45 +0,0 @@
-import time
-from contextlib import contextmanager
-from paramiko.ssh_exception import SSHException
-
-from report_ops.status import QuantifiRemote
-from report_ops.logger import get_logger
-
-logger = get_logger(__name__)
-
-
-@contextmanager
-def retry_on_exception_sftp():
- yield
-
-
-def close_and_reconnect():
- retries = 5
- for i in range(retries):
- try:
- with retry_on_exception_sftp():
- QuantifiRemote._client.client.close()
- QuantifiRemote.init_client()
- except (SSHException, OSError) as e:
- if i == retries - 1:
- raise e
- else:
- time.sleep(60 * i)
- else:
- return
-
-
-def run():
- while True:
- try:
- for f in QuantifiRemote._client.list_files("/OUTGOING/Status"):
- QuantifiRemote.process(f)
- except (SSHException, OSError) as e:
- logger.info(e)
- close_and_reconnect()
- time.sleep(60)
- QuantifiRemote.check_cache()
-
-
-if __name__ == "__main__":
- run()