Remove workspace-root configuration and use client run directories
This commit is contained in:
@@ -17,22 +17,12 @@ import (
|
||||
|
||||
// Handler serves the persistent connection. Canceling ctx stops active clients.
|
||||
func Handler(ctx context.Context, stores ...*pipeline.Store) http.Handler {
|
||||
return handler(ctx, nil, stores...)
|
||||
}
|
||||
|
||||
// HandlerForWorkspaces permits run workspaces only below explicitly configured roots.
|
||||
func HandlerForWorkspaces(ctx context.Context, store *pipeline.Store, roots []string) http.Handler {
|
||||
return handler(ctx, roots, store)
|
||||
}
|
||||
|
||||
func handler(ctx context.Context, roots []string, stores ...*pipeline.Store) http.Handler {
|
||||
mux := http.NewServeMux()
|
||||
var runs *runner
|
||||
var runErr error
|
||||
if len(stores) > 0 {
|
||||
runs, runErr = newRunner(ctx, stores[0])
|
||||
if runErr == nil {
|
||||
runs.workspaceRoots = append([]string(nil), roots...)
|
||||
runs.schedulerWG.Add(1)
|
||||
go runs.scheduleLoop()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user