From b2f47d8a753b796eda54103ee2c3337c9f36ec9b Mon Sep 17 00:00:00 2001 From: postmannen Date: Tue, 13 Apr 2021 14:37:17 +0200 Subject: [PATCH] renamed reqestTimeout to replyTimeout --- .gitignore | 3 ++- README.md | 20 +++++++++---------- example/toShip1-REQCliCommand.json | 8 +++++--- example/toShip2-REQOpCmdStart_REQHttpGet.json | 4 ++-- example/toShip2-REQOpCmdStop_REQHttpGet.json | 4 ++-- example/toShip2-REQOpPs.json | 4 ++-- message_and_subject.go | 4 ++-- subscriber_method_types.go | 6 +++--- 8 files changed, 28 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index 3b0fc2e..2a6cb35 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ ship1/ ship2/ tmp/ -incommmingBuffer.db +var/ +./incommmingBuffer.db store.log changes.md steward.sock diff --git a/README.md b/README.md index 75d0279..f6967f8 100644 --- a/README.md +++ b/README.md @@ -206,9 +206,9 @@ timeout // Normal Resend retries retries // The timeout of the new message created via a request event. -requestTimeout +replyTimeout // The retries of the new message created via a request event. -requestRetries +replyRetries // Timeout for how long a process should be allowed to operate methodTimeout ``` @@ -234,9 +234,9 @@ Timeout int `json:"timeout" yaml:"timeout"` // Normal Resend retries Retries int `json:"retries" yaml:"retries"` // The timeout of the new message created via a request event. -RequestTimeout int `json:"requestTimeout" yaml:"requestTimeout"` +ReplyTimeout int `json:"replyTimeout" yaml:"replyTimeout"` // The retries of the new message created via a request event. -RequestRetries int `json:"requestRetries" yaml:"requestRetries"` +ReplyRetries int `json:"replyRetries" yaml:"replyRetries"` // Timeout for long a process should be allowed to operate MethodTimeout int `json:"methodTimeout" yaml:"methodTimeout"` // Directory is a string that can be used to create the @@ -365,8 +365,8 @@ To send a Op Command message for process listing with custom timeout and amount }, "timeout":3, "retries":3, - "requestTimeout":3, - "requestRetries":3, + "replyTimeout":3, + "replyRetries":3, "MethodTimeout": 7 } ] @@ -392,8 +392,8 @@ To send and Op Command to stop a subscriber on a node }, "timeout":3, "retries":3, - "requestTimeout":3, - "requestRetries":3, + "replyTimeout":3, + "replyRetries":3, "MethodTimeout": 7 } ] @@ -418,8 +418,8 @@ To send and Op Command to start a subscriber on a node }, "timeout":3, "retries":3, - "requestTimeout":3, - "requestRetries":3, + "replyTimeout":3, + "replyRetries":3, "MethodTimeout": 7 } ] diff --git a/example/toShip1-REQCliCommand.json b/example/toShip1-REQCliCommand.json index f68714d..23d6678 100644 --- a/example/toShip1-REQCliCommand.json +++ b/example/toShip1-REQCliCommand.json @@ -3,10 +3,12 @@ "directory":"cli_command__result", "fileExtension": ".result", "toNode": "ship1", - "data": ["bash","-c","sleep 3 & tree ./"], + "data": ["bash","-c","sleep 5 & tree ./"], "method":"REQCliCommand", - "timeout":10, + "timeout":5, "retries":3, - "methodTimeout": 4 + "replyTimeout":5, + "replyRetries":3, + "methodTimeout": 10 } ] \ No newline at end of file diff --git a/example/toShip2-REQOpCmdStart_REQHttpGet.json b/example/toShip2-REQOpCmdStart_REQHttpGet.json index cd18c0d..c31688c 100644 --- a/example/toShip2-REQOpCmdStart_REQHttpGet.json +++ b/example/toShip2-REQOpCmdStart_REQHttpGet.json @@ -14,8 +14,8 @@ }, "timeout":3, "retries":3, - "requestTimeout":3, - "requestRetries":3, + "replyTimeout":3, + "replyRetries":3, "MethodTimeout": 7 } ] \ No newline at end of file diff --git a/example/toShip2-REQOpCmdStop_REQHttpGet.json b/example/toShip2-REQOpCmdStop_REQHttpGet.json index 4417dfc..bc932a0 100644 --- a/example/toShip2-REQOpCmdStop_REQHttpGet.json +++ b/example/toShip2-REQOpCmdStop_REQHttpGet.json @@ -15,8 +15,8 @@ }, "timeout":3, "retries":3, - "requestTimeout":3, - "requestRetries":3, + "replyTimeout":3, + "replyRetries":3, "MethodTimeout": 7 } ] \ No newline at end of file diff --git a/example/toShip2-REQOpPs.json b/example/toShip2-REQOpPs.json index 939af97..62c5c99 100644 --- a/example/toShip2-REQOpPs.json +++ b/example/toShip2-REQOpPs.json @@ -10,8 +10,8 @@ }, "timeout":3, "retries":3, - "requestTimeout":3, - "requestRetries":3, + "replyTimeout":3, + "replyRetries":3, "MethodTimeout": 7 } ] \ No newline at end of file diff --git a/message_and_subject.go b/message_and_subject.go index 87dc1e5..16757f0 100644 --- a/message_and_subject.go +++ b/message_and_subject.go @@ -31,9 +31,9 @@ type Message struct { // Normal Resend retries Retries int `json:"retries" yaml:"retries"` // The timeout of the new message created via a request event. - RequestTimeout int `json:"requestTimeout" yaml:"requestTimeout"` + ReplyTimeout int `json:"replyTimeout" yaml:"replyTimeout"` // The retries of the new message created via a request event. - RequestRetries int `json:"requestRetries" yaml:"requestRetries"` + ReplyRetries int `json:"replyRetries" yaml:"replyRetries"` // Timeout for long a process should be allowed to operate MethodTimeout int `json:"methodTimeout" yaml:"methodTimeout"` // Directory is a string that can be used to create the diff --git a/subscriber_method_types.go b/subscriber_method_types.go index fe9e6de..ed7f215 100644 --- a/subscriber_method_types.go +++ b/subscriber_method_types.go @@ -397,8 +397,8 @@ func newReplyMessage(proc process, message Message, method Method, outData []byt ToNode: message.FromNode, Data: []string{string(outData)}, Method: method, - Timeout: message.RequestTimeout, - Retries: message.RequestRetries, + Timeout: message.ReplyTimeout, + Retries: message.ReplyRetries, // Put in a copy of the initial request message, so we can use it's properties if // needed to for example create the file structure naming on the subscriber. @@ -600,7 +600,7 @@ func (m methodREQErrorLog) handler(proc process, message Message, node string) ( // Open file and write data. file := filepath.Join(folderTree, fileName) - f, err := os.OpenFile(file, os.O_APPEND|os.O_RDWR|os.O_CREATE, os.ModeAppend) + f, err := os.OpenFile(file, os.O_APPEND|os.O_RDWR|os.O_CREATE|os.O_SYNC, os.ModeAppend) if err != nil { log.Printf("error: methodEventTextLogging.handler: failed to open file: %v\n", err) return nil, err