@@ -19,6 +19,9 @@ import (
1919func pathConfCanBeUpdated (oldPathConf * conf.Path , newPathConf * conf.Path ) bool {
2020 clone := oldPathConf .Clone ()
2121
22+ clone .Name = newPathConf .Name
23+ clone .Regexp = newPathConf .Regexp
24+
2225 clone .Record = newPathConf .Record
2326
2427 clone .RPICameraBrightness = newPathConf .RPICameraBrightness
@@ -38,11 +41,6 @@ func pathConfCanBeUpdated(oldPathConf *conf.Path, newPathConf *conf.Path) bool {
3841 clone .RPICameraIDRPeriod = newPathConf .RPICameraIDRPeriod
3942 clone .RPICameraBitrate = newPathConf .RPICameraBitrate
4043
41- if oldPathConf .Name == "all" || oldPathConf .Name == "all_others" {
42- clone .Name = newPathConf .Name
43- clone .Regexp = newPathConf .Regexp
44- }
45-
4644 return newPathConf .Equal (clone )
4745}
4846
@@ -221,15 +219,17 @@ func (pm *pathManager) doReloadConf(newPaths map[string]*conf.Path) {
221219 continue
222220 }
223221
224- // path now belongs to a different config with exact name match
225- if newConf , exists := newPaths [pathName ]; exists && newConf .Name == pathName {
226- if pathConfCanBeUpdated (path .conf , newConf ) {
222+ // path now belongs to a different config
223+ if pathConf .Name != path .conf .Name {
224+ // path config can be hot reloaded
225+ if pathConfCanBeUpdated (path .conf , pathConf ) {
227226 // Hot reload the path with the new configuration
228- go path .reloadConf (newConf )
229- } else {
230- // Configuration cannot be hot reloaded: recreate the path
231- pm .removeAndClosePath (path )
227+ go path .reloadConf (pathConf )
228+ continue
232229 }
230+
231+ // Configuration cannot be hot reloaded: delete the path
232+ pm .removeAndClosePath (path )
233233 continue
234234 }
235235
0 commit comments