diff --git a/message_and_subject.go b/message_and_subject.go index 25a13c9..7cff482 100644 --- a/message_and_subject.go +++ b/message_and_subject.go @@ -84,14 +84,6 @@ type Message struct { PreviousMessage *Message // Schedule Schedule []int `json:"schedule" yaml:"schedule"` - - // ctx for the specifix message. Used for for example canceling - // scheduled messages. - // NB: Commented out this field for specific message context - // to be used within handlers, since it will override the structure - // we have today. Keeping the code for a bit incase it makes sense - // to implement later. - //ctx context.Context } // --- Subject diff --git a/process.go b/process.go index fa38778..59f6cf2 100644 --- a/process.go +++ b/process.go @@ -48,7 +48,6 @@ type process struct { // also one subject subject Subject // Put a node here to be able know the node a process is at. - // NB: Might not be needed later on. node Node // The processID for the current process processID int @@ -685,13 +684,6 @@ func executeHandler(p process, message Message, thisNode string) { defer intervalTicker.Stop() defer totalTimeTicker.Stop() - // NB: Commented out this assignement of a specific message context - // to be used within handlers, since it will override the structure - // we have today. Keeping the code for a bit incase it makes sense - // to implement later. - //ctx, cancel := context.WithCancel(p.ctx) - //message.ctx = ctx - // Run the handler once, so we don't have to wait for the first ticker. go func() { _, err := p.handler(p, message, thisNode) diff --git a/requests.go b/requests.go index 942c495..514cb0a 100644 --- a/requests.go +++ b/requests.go @@ -403,7 +403,3 @@ func selectFileNaming(message Message, proc process) (string, string) { return fileName, folderTree } - -// ------------------------------------------------------------ -// Subscriber method handlers -// ------------------------------------------------------------ diff --git a/requests_acl.go b/requests_acl.go index 713e638..c730b45 100644 --- a/requests_acl.go +++ b/requests_acl.go @@ -84,7 +84,7 @@ func methodREQAclRequestUpdate(proc process, message Message, node string) ([]by } }() - // NB: We're not sending an ACK message for this request type. + // We're not sending an ACK message for this request type. return nil, nil } diff --git a/requests_copy.go b/requests_copy.go index 3e50de3..e93275c 100644 --- a/requests_copy.go +++ b/requests_copy.go @@ -324,7 +324,7 @@ func methodREQCopyDst(proc process, message Message, node string) ([]byte, error // the processName. If true, return here and don't start up another // process for that file. // - // NB: This check is put in here if a message for some reason are + // This check is put in here if a message for some reason are // received more than once. The reason that this might happen can be // that a message for the same copy request was received earlier, but // was unable to start up within the timeout specified. The Sender of diff --git a/requests_http.go b/requests_http.go index 96d9363..a3661d8 100644 --- a/requests_http.go +++ b/requests_http.go @@ -152,7 +152,7 @@ func methodREQHttpGetScheduled(proc process, message Message, node string) ([]by ticker := time.NewTicker(time.Second * time.Duration(scheduleInterval)) // Prepare a context that will be for the schedule as a whole. - // NB: Individual http get's will create their own context's + // Individual http get's will create their own context's // derived from this one. ctxScheduler, cancel := context.WithTimeout(proc.ctx, time.Minute*time.Duration(schedulerTotalTime)) diff --git a/requests_keys.go b/requests_keys.go index 918549d..a399a27 100644 --- a/requests_keys.go +++ b/requests_keys.go @@ -115,7 +115,7 @@ func methodREQKeysRequestUpdate(proc process, message Message, node string) ([]b } }() - // NB: We're not sending an ACK message for this request type. + // We're not sending an ACK message for this request type. return nil, nil } @@ -264,7 +264,7 @@ func methodREQKeysAllow(proc process, message Message, node string) ([]byte, err // If new keys were allowed into the main map, we should send out one // single update to all the registered nodes to inform of an update. - // NB: If a node is not reachable at the time the update is sent it is + // If a node is not reachable at the time the update is sent it is // not a problem since the nodes will periodically check for updates. // // If there are errors we will return from the function, and send no diff --git a/server.go b/server.go index d105ad6..073d3ff 100644 --- a/server.go +++ b/server.go @@ -335,7 +335,7 @@ func (s *server) Start() { // Since all the logic to handle processes are tied to the process // struct, we need to create an initial process to start the rest. // - // NB: The context of the initial process are set in processes.Start. + // The context of the initial process are set in processes.Start. sub := newSubject(REQInitial, s.nodeName) s.processInitial = newProcess(context.TODO(), s, sub, "") // Start all wanted subscriber processes. @@ -351,8 +351,6 @@ func (s *server) Start() { } // Start the processing of new messages from an input channel. - // NB: We might need to create a sub context for the ringbuffer here - // so we can cancel this context last, and not use the server. s.routeMessagesToProcess() // Start reading the channel for injecting direct messages that should