X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f1fb39153bc234b49ca77674a29abc029b12774a..8622b46a4a6c127a1927d9c2e54febec6a5bf503:/services/crunch-run/crunchrun.go?ds=sidebyside diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go index b95ae1b4d3..272ad0b18e 100644 --- a/services/crunch-run/crunchrun.go +++ b/services/crunch-run/crunchrun.go @@ -630,12 +630,8 @@ func (runner *ContainerRunner) LogNodeInfo() (err error) { // Get and save the raw JSON container record from the API server func (runner *ContainerRunner) LogContainerRecord() (err error) { - w := &ArvLogWriter{ - ArvClient: runner.ArvClient, - UUID: runner.Container.UUID, - loggingStream: "container", - writeCloser: runner.LogCollection.Open("container.json"), - } + w := NewArvLogWriter(runner.ArvClient, runner.Container.UUID, "container", + runner.LogCollection.Open("container.json")) // Get Container record JSON from the API Server reader, err := runner.ArvClient.CallRaw("GET", "containers", runner.Container.UUID, "", nil) if err != nil { @@ -1061,8 +1057,7 @@ func (runner *ContainerRunner) CommitLogs() error { // point, but re-open crunch log with ArvClient in case there are any // other further (such as failing to write the log to Keep!) while // shutting down - runner.CrunchLog = NewThrottledLogger(&ArvLogWriter{ArvClient: runner.ArvClient, - UUID: runner.Container.UUID, loggingStream: "crunch-run", writeCloser: nil}) + runner.CrunchLog = NewThrottledLogger(NewArvLogWriter(runner.ArvClient, runner.Container.UUID, "crunch-run", nil)) if runner.LogsPDH != nil { // If we have already assigned something to LogsPDH, @@ -1149,7 +1144,7 @@ func (runner *ContainerRunner) IsCancelled() bool { // NewArvLogWriter creates an ArvLogWriter func (runner *ContainerRunner) NewArvLogWriter(name string) io.WriteCloser { - return &ArvLogWriter{ArvClient: runner.ArvClient, UUID: runner.Container.UUID, loggingStream: name, writeCloser: runner.LogCollection.Open(name + ".txt")} + return NewArvLogWriter(runner.ArvClient, runner.Container.UUID, name, runner.LogCollection.Open(name+".txt")) } // Run the full container lifecycle.