(memory_limit_float = 85.0)
| 19 | |
| 20 | |
| 21 | def is_memory_available(memory_limit_float = 85.0): |
| 22 | memory_percent = get_memory_percent() |
| 23 | logger.debug(f'Checking for memory {memory_percent}%') |
| 24 | if memory_percent is None: return True # Don't stop if this check fails |
| 25 | |
| 26 | if memory_percent > memory_limit_float: |
| 27 | logger.warn(f"[Memory] {memory_percent} % used is > {memory_limit_float} limit.") |
| 28 | return False |
| 29 | |
| 30 | return True |
| 31 | |
| 32 | |
| 33 | def check_and_wait_for_memory(memory_limit_float = 85.0, check_interval = 5): |
no test coverage detected