def handle_job_disconnected_ws(ws): ws_manager.remove_sockets(ws) if not ws_manager.ws: logger.info('Stopping resources monitor for job %s', job_name) RedisToStream.remove_job_resources(job_uuid=job_uuid) request.app.job_resources_ws_mangers.pop(job_uuid, None) logger.info('Quitting resources socket for job %s', job_name)
def handle_job_disconnected_ws(ws): ws_manager.remove_sockets(ws) if not ws_manager.ws: logger.info('Stopping resources monitor for job %s', job_name) RedisToStream.remove_job_resources(job_uuid=job_uuid) request.app.job_resources_ws_mangers.pop(job_uuid, None) logger.info('Quitting resources socket for job %s', job_name)
def test_job_monitoring(self): job_uuid = uuid.uuid4().hex assert RedisToStream.is_monitored_job_resources(job_uuid) is False RedisToStream.monitor_job_resources(job_uuid) assert RedisToStream.is_monitored_job_resources(job_uuid) is True RedisToStream.remove_job_resources(job_uuid) assert RedisToStream.is_monitored_job_resources(job_uuid) is False assert RedisToStream.is_monitored_job_logs(job_uuid) is False RedisToStream.monitor_job_logs(job_uuid) assert RedisToStream.is_monitored_job_logs(job_uuid) is True RedisToStream.remove_job_logs(job_uuid) assert RedisToStream.is_monitored_job_logs(job_uuid) is False
def test_job_monitoring(self): job_uuid = uuid.uuid4().hex assert RedisToStream.is_monitored_job_resources(job_uuid) is False RedisToStream.monitor_job_resources(job_uuid) assert RedisToStream.is_monitored_job_resources(job_uuid) is True RedisToStream.remove_job_resources(job_uuid) assert RedisToStream.is_monitored_job_resources(job_uuid) is False assert RedisToStream.is_monitored_job_logs(job_uuid) is False RedisToStream.monitor_job_logs(job_uuid) assert RedisToStream.is_monitored_job_logs(job_uuid) is True RedisToStream.remove_job_logs(job_uuid) assert RedisToStream.is_monitored_job_logs(job_uuid) is False