mirror of
https://github.com/postmannen/ctrl.git
synced 2025-03-05 06:46:48 +00:00
logging and comments
This commit is contained in:
parent
b1bcefb949
commit
efc5df5b16
2 changed files with 5 additions and 51 deletions
10
process.go
10
process.go
|
@ -841,16 +841,6 @@ func (p process) publishAMessage(m Message, zEnc *zstd.Encoder, once sync.Once,
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// NB: vvvvvvvvvvvvvvvvvvvvv-THIS DOES NOT WORK FOR CANCELING THE PUBLISHER-vvvvvvvvv
|
|
||||||
//if m.IsSubPublishedMsg {
|
|
||||||
// p.ctxCancel()
|
|
||||||
// go func() {
|
|
||||||
// p.processes.active.mu.Lock()
|
|
||||||
// delete(p.processes.active.procNames, p.processName)
|
|
||||||
// p.processes.active.mu.Unlock()
|
|
||||||
// }()
|
|
||||||
//}
|
|
||||||
|
|
||||||
// Increment the counter for the next message to be sent.
|
// Increment the counter for the next message to be sent.
|
||||||
p.messageID++
|
p.messageID++
|
||||||
|
|
||||||
|
|
46
server.go
46
server.go
|
@ -341,46 +341,9 @@ func (s *server) Stop() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// sendInfoMessage will put the error message directly on the channel that is
|
// samDBValueAndDelivered Contains the sam value as it is used in the
|
||||||
// read by the nats publishing functions.
|
// state DB, and also a delivered function to be called when this message
|
||||||
//
|
// is picked up, so we can control if messages gets stale at some point.
|
||||||
// DEPRECATED:
|
|
||||||
// func sendInfoLogMessage(conf *Configuration, metrics *metrics, ringBufferBulkInCh chan<- []subjectAndMessage, FromNode Node, theError error) {
|
|
||||||
// // NB: Adding log statement here for more visuality during development.
|
|
||||||
// log.Printf("%v\n", theError)
|
|
||||||
// sam := createErrorMsgContent(conf, FromNode, theError)
|
|
||||||
// ringBufferBulkInCh <- []subjectAndMessage{sam}
|
|
||||||
//
|
|
||||||
// metrics.promInfoMessagesSentTotal.Inc()
|
|
||||||
// }
|
|
||||||
|
|
||||||
// DEPRECATED
|
|
||||||
// // createErrorMsgContent will prepare a subject and message with the content
|
|
||||||
// // of the error
|
|
||||||
// func createErrorMsgContent(conf *Configuration, FromNode Node, theError error) subjectAndMessage {
|
|
||||||
// // Add time stamp
|
|
||||||
// er := fmt.Sprintf("%v, node: %v, %v\n", time.Now().Format("Mon Jan _2 15:04:05 2006"), FromNode, theError.Error())
|
|
||||||
//
|
|
||||||
// sam := subjectAndMessage{
|
|
||||||
// Subject: newSubject(REQErrorLog, "errorCentral"),
|
|
||||||
// Message: Message{
|
|
||||||
// Directory: "errorLog",
|
|
||||||
// ToNode: "errorCentral",
|
|
||||||
// FromNode: FromNode,
|
|
||||||
// FileName: "error.log",
|
|
||||||
// Data: []byte(er),
|
|
||||||
// Method: REQErrorLog,
|
|
||||||
// ACKTimeout: conf.ErrorMessageTimeout,
|
|
||||||
// Retries: conf.ErrorMessageRetries,
|
|
||||||
// },
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return sam
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Contains the sam value as it is used in the state DB, and also a
|
|
||||||
// delivered function to be called when this message is picked up, so
|
|
||||||
// we can control if messages gets stale at some point.
|
|
||||||
type samDBValueAndDelivered struct {
|
type samDBValueAndDelivered struct {
|
||||||
samDBValue samDBValue
|
samDBValue samDBValue
|
||||||
delivered func()
|
delivered func()
|
||||||
|
@ -492,7 +455,8 @@ func (s *server) routeMessagesToProcess(dbFileName string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
proc.spawnWorker()
|
proc.spawnWorker()
|
||||||
// log.Printf("info: processNewMessages: new process started, subject: %v, processID: %v\n", subjName, proc.processID)
|
er := fmt.Errorf("info: processNewMessages: new process started, subject: %v, processID: %v", subjName, proc.processID)
|
||||||
|
s.errorKernel.logConsoleOnlyIfDebug(er, s.configuration)
|
||||||
|
|
||||||
// Now when the process is spawned we continue,
|
// Now when the process is spawned we continue,
|
||||||
// and send the message to that new process.
|
// and send the message to that new process.
|
||||||
|
|
Loading…
Add table
Reference in a new issue