diff --git a/process.go b/process.go index 58f878b..bd2b6a8 100644 --- a/process.go +++ b/process.go @@ -535,7 +535,7 @@ func executeHandler(p process, message Message, thisNode string) { } switch { - case !runAsScheduled: + case !runAsScheduled && p.handler != nil: go func() { _, err = p.handler(p, message, thisNode) diff --git a/processes.go b/processes.go index 9feeb03..cea63b2 100644 --- a/processes.go +++ b/processes.go @@ -132,7 +132,7 @@ func (p *processes) Start(proc process) { } if proc.configuration.StartProcesses.EnableKeyUpdates { - proc.startup.startProcess(proc, KeysRequestUpdate, procFuncKeysRequestUpdate) + proc.startup.startProcess(proc, KeysRequestUpdatePublisher, procFuncKeysRequestUpdate) proc.startup.startProcess(proc, KeysDeliverUpdate, nil) } diff --git a/requests.go b/requests.go index 31dd020..72ca39f 100644 --- a/requests.go +++ b/requests.go @@ -129,6 +129,8 @@ const ( KeysRequestUpdate Method = "keysRequestUpdate" // REQKeysRequestUpdatePublisher send the current hash of the locally stored public keys to // the central key server, and get an update from central if needed. + KeysRequestUpdatePublisher Method = "keysRequestUpdatePublisher" + // REQKeysDeliverUpdate will deliver the public from central to a node. KeysDeliverUpdate Method = "keysDeliverUpdate" // REQKeysAllow KeysAllow Method = "keysAllow" @@ -193,16 +195,18 @@ func (m Method) GetMethodsAvailable() MethodsAvailable { // The hello publisher will not subscribe for messages, it will // only start a procFunc, so we we don't need a handler with a method, // so we set it to nil. - HelloPublisher: HandlerFunc(nil), - ErrorLog: HandlerFunc(methodErrorLog), - HttpGet: HandlerFunc(methodHttpGet), - HttpGetScheduled: HandlerFunc(methodHttpGetScheduled), - TailFile: HandlerFunc(methodTailFile), - PublicKey: HandlerFunc(methodPublicKey), - KeysRequestUpdate: HandlerFunc(methodKeysRequestUpdate), - KeysDeliverUpdate: HandlerFunc(methodKeysReceiveUpdate), - KeysAllow: HandlerFunc(methodKeysAllow), - KeysDelete: HandlerFunc(methodKeysDelete), + HelloPublisher: HandlerFunc(nil), + ErrorLog: HandlerFunc(methodErrorLog), + HttpGet: HandlerFunc(methodHttpGet), + HttpGetScheduled: HandlerFunc(methodHttpGetScheduled), + TailFile: HandlerFunc(methodTailFile), + PublicKey: HandlerFunc(methodPublicKey), + + KeysRequestUpdatePublisher: HandlerFunc(methodKeysRequestUpdate), + KeysRequestUpdate: HandlerFunc(nil), + KeysDeliverUpdate: HandlerFunc(methodKeysReceiveUpdate), + KeysAllow: HandlerFunc(methodKeysAllow), + KeysDelete: HandlerFunc(methodKeysDelete), AclRequestUpdate: HandlerFunc(methodAclRequestUpdate), AclDeliverUpdate: HandlerFunc(methodAclDeliverUpdate),