1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2025-01-18 21:59:30 +00:00

renamed v variable to sam in ringbuffer

This commit is contained in:
postmannen 2023-01-04 22:07:53 +01:00
parent 94135aab67
commit 4fe96b645e

View file

@ -175,10 +175,10 @@ func (r *ringBuffer) fillBuffer(ctx context.Context, inCh chan subjectAndMessage
// the go routine who reads the socket. // the go routine who reads the socket.
for { for {
select { select {
case v := <-inCh: case sam := <-inCh:
// Check if the event exists. // Check if the event exists.
if !eventAvailable.CheckIfExists(v.Event, v.Subject) { if !eventAvailable.CheckIfExists(sam.Event, sam.Subject) {
er := fmt.Errorf("error: fillBuffer: the event type do not exist, so this message will not be put on the buffer to be processed. Check the syntax used in the json file for the message. Allowed values are : %v, where given: event=%v, with subject=%v", eventAvailableValues, v.Event, v.Subject) er := fmt.Errorf("error: fillBuffer: the event type do not exist, so this message will not be put on the buffer to be processed. Check the syntax used in the json file for the message. Allowed values are : %v, where given: event=%v, with subject=%v", eventAvailableValues, sam.Event, sam.Subject)
r.errorKernel.errSend(r.processInitial, Message{}, er) r.errorKernel.errSend(r.processInitial, Message{}, er)
// if it was not a valid value, we jump back up, and // if it was not a valid value, we jump back up, and
@ -188,14 +188,14 @@ func (r *ringBuffer) fillBuffer(ctx context.Context, inCh chan subjectAndMessage
// Check if default message values for timers are set, and if // Check if default message values for timers are set, and if
// not then set default message values. // not then set default message values.
if v.Message.ACKTimeout < 1 { if sam.Message.ACKTimeout < 1 {
v.Message.ACKTimeout = r.configuration.DefaultMessageTimeout sam.Message.ACKTimeout = r.configuration.DefaultMessageTimeout
} }
if v.Message.Retries < 1 { if sam.Message.Retries < 1 {
v.Message.Retries = r.configuration.DefaultMessageRetries sam.Message.Retries = r.configuration.DefaultMessageRetries
} }
if v.Message.MethodTimeout < 1 && v.Message.MethodTimeout != -1 { if sam.Message.MethodTimeout < 1 && sam.Message.MethodTimeout != -1 {
v.Message.MethodTimeout = r.configuration.DefaultMethodTimeout sam.Message.MethodTimeout = r.configuration.DefaultMethodTimeout
} }
// --- Store the incomming message in the k/v store --- // --- Store the incomming message in the k/v store ---
@ -209,7 +209,7 @@ func (r *ringBuffer) fillBuffer(ctx context.Context, inCh chan subjectAndMessage
// Create a structure for JSON marshaling. // Create a structure for JSON marshaling.
samV := samDBValue{ samV := samDBValue{
ID: dbID, ID: dbID,
SAM: v, SAM: sam,
} }
if r.configuration.RingBufferPersistStore { if r.configuration.RingBufferPersistStore {