From 40c2eb3da2881142f12f5b4f221c792cb7f84168 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sun, 13 Dec 2020 00:18:40 +0100 Subject: [PATCH] forbid runOnPublish when source is not record (#143) --- internal/conf/pathconf.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/conf/pathconf.go b/internal/conf/pathconf.go index dc189661..9596e8d2 100644 --- a/internal/conf/pathconf.go +++ b/internal/conf/pathconf.go @@ -218,6 +218,10 @@ func (pconf *PathConf) fillAndCheck(name string) error { return fmt.Errorf("a path with a regular expression does not support option 'runOnInit'; use another path") } + if pconf.RunOnPublish != "" && pconf.Source != "record" { + return fmt.Errorf("'runOnPublish' is useless when source is not 'record', since the stream is not provided by a publisher, but by another source") + } + if pconf.RunOnDemandStartTimeout == 0 { pconf.RunOnDemandStartTimeout = 10 * time.Second }