Commit 18071e80 authored by Daniele Venzano's avatar Daniele Venzano
Browse files

Set the notebook termination notice flag

parent 913b0099
......@@ -10,5 +10,6 @@ conf = {
'apache-log-file': '/var/log/apache2/access.log',
'proxy_update_accesses': 300,
'check_health': 30,
'notebook_max_age_no_activity': 24
'notebook_max_age_no_activity': 24,
'notebook_warning_age_no_activity': 2
}
......@@ -203,6 +203,8 @@ class PlatformManager:
pr = state.query(Proxy).filter_by(container_id=c.id, service_name="Spark Notebook interface")
if datetime.now() - pr.last_access > timedelta(hours=conf["notebook_max_age_no_activity"]):
self.terminate_execution(state, e)
if datetime.now() - pr.last_access > timedelta(hours=conf["notebook_max_age_no_activity"]) - timedelta(hours=conf["notebook_warning_age_no_activity"]):
e.termination_notice = True
state.commit()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment