aboutsummaryrefslogtreecommitdiffstats
path: root/python/citco_ops
diff options
context:
space:
mode:
Diffstat (limited to 'python/citco_ops')
-rw-r--r--python/citco_ops/utils.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/python/citco_ops/utils.py b/python/citco_ops/utils.py
index 41450a36..450b2204 100644
--- a/python/citco_ops/utils.py
+++ b/python/citco_ops/utils.py
@@ -168,9 +168,17 @@ class CitcoSubmission(Deal, deal_type=None, table_name="citco_submission"):
return html
@classmethod
- def _init_sftp(cls):
+ def init_sftp(cls):
return SftpClient.from_creds("citco", folder="/outgoing/notifications")
+ @classmethod
+ def check_cache(cls):
+ if cls.process.cache_info().currsize == cls.process.cache_info().maxsize:
+ if (cls.process.cache_info().misses / cls.process.cache_info().hits) > 0.5:
+ raise ValueError(
+ "Too many files in the SFTP compared to cache max size"
+ )
+
_recipients = {
"ISOSEL": (