Don't run callback stuff when callback is not configured

This commit is contained in:
Adam Štrauch 2021-09-17 01:36:20 +02:00
parent 709c47af3e
commit a9d7abbdd5
Signed by: cx
GPG Key ID: 018304FFA8988F8D

View File

@ -193,8 +193,11 @@ func main() {
go printDiscoveryLogs()
go cleanDiscoveryPool()
go discoveryChangeLoop()
go changeCatcherLoop()
if len(config.Callback) > 0 {
go discoveryChangeLoop()
go changeCatcherLoop()
}
// When the daemon boots up we trigger discovery change event so the config can be setup via callback script if there is any
err = discoveryChange(server.Discovery{})