You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sped up the compilation/execution of snippets by using previously
started and idle docker containers, rather than starting a new one for
each request.
By sleeping for a long time in entrypoint.sh, containers stay idle.
Cargo is called through cargo.sh, which cares of exporting env vars
and killing the container once it's done. Thus, there's no need to drop
a container that has been used.
However idle containers need to me manually terminated:
DockerContainers Drop impl takes care of that.
let port = env::var("PLAYGROUND_UI_PORT").ok().and_then(|p| p.parse().ok()).unwrap_or(DEFAULT_PORT);
79
80
let logfile = env::var("PLAYGROUND_LOG_FILE").unwrap_or_else(|_| DEFAULT_LOG_FILE.to_string());
80
81
let cors_enabled = env::var_os("PLAYGROUND_CORS_ENABLED").is_some();
82
+
let docker_containers_pool_size = env::var("DOCKER_CONTAINER_POOL_SIZE").ok().and_then(|v| v.parse().ok()).unwrap_or(DEFAULT_DOCKER_CONTAINER_POOL_SIZE);
83
+
84
+
let containers = Arc::new(DockerContainers::new(docker_containers_pool_size));
81
85
82
86
let files = Staticfile::new(&root).expect("Unable to open root directory");
0 commit comments