Browse Source

fix compatibility between confwatcher and legacy configuration file (#1642)

pull/1653/head v0.22.0
Alessandro Ros 2 years ago committed by GitHub
parent
commit
adbd4b7296
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      internal/confwatcher/confwatcher.go

9
internal/confwatcher/confwatcher.go

@ -27,7 +27,14 @@ type ConfWatcher struct { @@ -27,7 +27,14 @@ type ConfWatcher struct {
// New allocates a ConfWatcher.
func New(confPath string) (*ConfWatcher, error) {
if _, err := os.Stat(confPath); err != nil {
return nil, err
if confPath == "mediamtx.yml" {
confPath = "rtsp-simple-server.yml"
if _, err := os.Stat(confPath); err != nil {
return nil, err
}
} else {
return nil, err
}
}
inner, err := fsnotify.NewWatcher()

Loading…
Cancel
Save