Attention une mise à jour du service Gitlab va être effectuée le mardi 14 décembre entre 13h30 et 14h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes.

Commit 1034e760 authored by LUXEY Adrien's avatar LUXEY Adrien
Browse files

finally seems to work

parent ddaf07dc
...@@ -137,8 +137,11 @@ func (st *StoryTeller) AddInteractionReceiver(receiver chan<- Item) { ...@@ -137,8 +137,11 @@ func (st *StoryTeller) AddInteractionReceiver(receiver chan<- Item) {
func (st *StoryTeller) NotifyInteractionReceivers(items ...Item) { func (st *StoryTeller) NotifyInteractionReceivers(items ...Item) {
for _, it := range items { for _, it := range items {
for _, ch := range st.interactionReceviers { for i, ch := range st.interactionReceviers {
go func() { ch <- it }() go func(ch chan<- Item, it Item) {
ch <- it
st.debug.Printf("Successfully notified receiver #%d of interaction: %v\n", i, it)
}(ch, it)
} }
} }
} }
...@@ -290,6 +293,9 @@ func (st *StoryTeller) handleRequest(mess transport.Message) { ...@@ -290,6 +293,9 @@ func (st *StoryTeller) handleRequest(mess transport.Message) {
// We update our sequence with the received payload // We update our sequence with the received payload
newInteractions := st.sequence.Merge(recSeq) newInteractions := st.sequence.Merge(recSeq)
if len(newInteractions) > 0 {
st.NotifyInteractionReceivers(newInteractions...)
}
// Just a little logging // Just a little logging
if st.csv != nil { if st.csv != nil {
...@@ -298,7 +304,6 @@ func (st *StoryTeller) handleRequest(mess transport.Message) { ...@@ -298,7 +304,6 @@ func (st *StoryTeller) handleRequest(mess transport.Message) {
if len(newInteractions) == 0 { if len(newInteractions) == 0 {
st.nUselessMessages++ st.nUselessMessages++
} else { } else {
go st.NotifyInteractionReceivers(newInteractions...)
// If my sequence was updated, add a csv line // If my sequence was updated, add a csv line
go st.addLogLine(time.Now(), payload.Sender) go st.addLogLine(time.Now(), payload.Sender)
} }
...@@ -387,13 +392,15 @@ func (st *StoryTeller) handleAnswer(mess transport.Message) { ...@@ -387,13 +392,15 @@ func (st *StoryTeller) handleAnswer(mess transport.Message) {
// We update our sequence with the received payload // We update our sequence with the received payload
newInteractions := st.sequence.Merge(recSeq) newInteractions := st.sequence.Merge(recSeq)
if len(newInteractions) > 0 {
st.NotifyInteractionReceivers(newInteractions...)
}
if st.csv != nil { if st.csv != nil {
st.nMessages++ st.nMessages++
if len(newInteractions) == 0 { if len(newInteractions) == 0 {
st.nUselessMessages++ st.nUselessMessages++
} else { } else {
st.NotifyInteractionReceivers(newInteractions...)
// If my sequence was updated and we log, add a csv line // If my sequence was updated and we log, add a csv line
go st.addLogLine(time.Now(), payload.Sender) go st.addLogLine(time.Now(), payload.Sender)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment