mirror of
https://github.com/postmannen/ctrl.git
synced 2024-12-14 12:37:31 +00:00
fixed bug where error message failed when kv store where missing
This commit is contained in:
parent
91ac5da4d6
commit
be8008b5a0
2 changed files with 6 additions and 5 deletions
|
@ -150,7 +150,6 @@ func (p process) spawnWorker(procs *processes, natsConn *nats.Conn) {
|
|||
|
||||
// If there is a procFunc for the process, start it.
|
||||
if p.procFunc != nil {
|
||||
|
||||
// Start the procFunc in it's own anonymous func so we are able
|
||||
// to get the return error.
|
||||
go func() {
|
||||
|
@ -411,7 +410,6 @@ func (p process) publishMessages(natsConn *nats.Conn) {
|
|||
sendErrorLogMessage(p.toRingbufferCh, node(p.node), er)
|
||||
return
|
||||
}
|
||||
|
||||
// Get the process name so we can look up the process in the
|
||||
// processes map, and increment the message counter.
|
||||
pn := processNameGet(p.subject.name(), processKindPublisher)
|
||||
|
|
|
@ -103,11 +103,14 @@ func (r *ringBuffer) fillBuffer(inCh chan subjectAndMessage, samValueBucket stri
|
|||
// messages to the system.
|
||||
// This is needed when the program have been restarted, and we need to check
|
||||
// if there where previously unhandled messages that need to be handled first.
|
||||
|
||||
func() {
|
||||
s, err := r.dumpBucket(samValueBucket)
|
||||
if err != nil {
|
||||
er := fmt.Errorf("error: fillBuffer: retreival of values from k/v store failed: %v", err)
|
||||
sendErrorLogMessage(r.newMessagesCh, node(r.nodeName), er)
|
||||
er := fmt.Errorf("error: fillBuffer: retreival of values from k/v store failed, probaly empty database so we don't have any previos entries in db: %v", err)
|
||||
log.Printf("%v\n", er)
|
||||
return
|
||||
//sendErrorLogMessage(r.newMessagesCh, node(r.nodeName), er)
|
||||
}
|
||||
|
||||
for _, v := range s {
|
||||
|
@ -329,7 +332,7 @@ func (r *ringBuffer) getIndexValue(indexBucket string) int {
|
|||
log.Printf("error: getIndexValue: strconv.Atoi : %v\n", err)
|
||||
}
|
||||
|
||||
// fmt.Printf("ringBuffer.getIndexValue: got index value = %v\n", index)
|
||||
// fmt.Printf("\n**** ringBuffer.getIndexValue: got index value = %v\n\n", index)
|
||||
|
||||
return index
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue