diff --git a/internal/core/path.go b/internal/core/path.go index 611a5ca9..93d92fc4 100644 --- a/internal/core/path.go +++ b/internal/core/path.go @@ -279,10 +279,6 @@ func (pa *path) run() { req.Res <- defs.PathAddReaderRes{Err: fmt.Errorf("terminated")} } - if pa.stream != nil { - pa.setNotAvailable() - } - if pa.source != nil { if source, ok := pa.source.(*staticsources.Handler); ok { if !pa.conf.SourceOnDemand || pa.onDemandStaticSourceState != pathOnDemandStateInitial { @@ -297,6 +293,10 @@ func (pa *path) run() { pa.onUnDemandHook("path destroyed") } + if pa.stream != nil { + pa.setNotAvailable() + } + pa.Log(logger.Debug, "destroyed: %v", err) }