From 902b759e810a6293962bb8db526c4436f5111092 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Fri, 3 Sep 2021 14:14:42 -0700 Subject: [PATCH] Map logging --- protocol/connections/peerapp.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/protocol/connections/peerapp.go b/protocol/connections/peerapp.go index 59332b6..55d8706 100644 --- a/protocol/connections/peerapp.go +++ b/protocol/connections/peerapp.go @@ -89,6 +89,7 @@ func (pa *PeerApp) listen() { case event.ContextAck: pa.OnAcknowledgement(pa.connection.Hostname(), peerMessage.ID) case event.ContextRetVal: + log.Infof("Loading from map %x", pa.getValRequests) req, ok := pa.getValRequests.Load(peerMessage.ID) if ok { reqStr := []byte(req.(string)) @@ -112,6 +113,7 @@ func (pa *PeerApp) listen() { // NOTE: This is a stub, we will likely want to extend this to better reflect the desired protocol func (pa *PeerApp) SendMessage(message model2.PeerMessage) error { if message.Context == event.ContextGetVal { + log.Infof("Saving to map %x", pa.getValRequests) pa.getValRequests.Store(message.ID, string(message.Data)) // sync map is apparently not guaranteed to be consistent _, ok := pa.getValRequests.Load(message.ID)