1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2025-01-05 20:09:16 +00:00

added replyMethodTimeout to message

This commit is contained in:
postmannen 2021-09-16 12:37:46 +02:00
parent b279cf40bf
commit d5082cc7a4
3 changed files with 16 additions and 6 deletions

View file

@ -475,11 +475,15 @@ method
// Additional arguments that might be needed when executing the // Additional arguments that might be needed when executing the
// method. Can be f.ex. an ip address if it is a tcp sender, or the // method. Can be f.ex. an ip address if it is a tcp sender, or the
// shell command to execute in a cli session. // shell command to execute in a cli session.
MethodArgs []string `json:"methodArgs" yaml:"methodArgs"` MethodArgs []string
// ReplyMethod, is the method to use for the reply message. // ReplyMethod, is the method to use for the reply message.
// By default the reply method will be set to log to file, but // By default the reply method will be set to log to file, but
// you can override it setting your own here. // you can override it setting your own here.
replyMethod replyMethod
// Additional arguments that might be needed when executing the reply
// method. Can be f.ex. an ip address if it is a tcp sender, or the
// shell command to execute in a cli session.
ReplyMethodArgs []string
// Initial message Reply ACK wait timeout // Initial message Reply ACK wait timeout
ACKTimeout ACKTimeout
// Normal Resend retries // Normal Resend retries
@ -490,6 +494,8 @@ replyACKTimeout
replyRetries replyRetries
// Timeout for long a process should be allowed to operate // Timeout for long a process should be allowed to operate
methodTimeout methodTimeout
// Timeout for long a process should be allowed to operate
ReplyMethodTimeout int
// Directory is a string that can be used to create the // Directory is a string that can be used to create the
//directory structure when saving the result of some method. //directory structure when saving the result of some method.
// For example "syslog","metrics", or "metrics/mysensor" // For example "syslog","metrics", or "metrics/mysensor"

View file

@ -52,6 +52,8 @@ type Message struct {
ReplyRetries int `json:"replyRetries" yaml:"replyRetries"` ReplyRetries int `json:"replyRetries" yaml:"replyRetries"`
// Timeout for long a process should be allowed to operate // Timeout for long a process should be allowed to operate
MethodTimeout int `json:"methodTimeout" yaml:"methodTimeout"` MethodTimeout int `json:"methodTimeout" yaml:"methodTimeout"`
// Timeout for long a process should be allowed to operate
ReplyMethodTimeout int `json:"replyMethodTimeout" yaml:"replyMethodTimeout"`
// Directory is a string that can be used to create the // Directory is a string that can be used to create the
//directory structure when saving the result of some method. //directory structure when saving the result of some method.
// For example "syslog","metrics", or "metrics/mysensor" // For example "syslog","metrics", or "metrics/mysensor"

View file

@ -274,6 +274,8 @@ func newReplyMessage(proc process, message Message, outData []byte) {
ToNode: message.FromNode, ToNode: message.FromNode,
Data: []string{string(outData)}, Data: []string{string(outData)},
Method: message.ReplyMethod, Method: message.ReplyMethod,
MethodArgs: message.ReplyMethodArgs,
MethodTimeout: message.ReplyMethodTimeout,
ACKTimeout: message.ReplyACKTimeout, ACKTimeout: message.ReplyACKTimeout,
Retries: message.ReplyRetries, Retries: message.ReplyRetries,