From 77e4e981e879531ec53523ef53629a6999ba297c Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 11 Jul 2023 13:21:26 -0700 Subject: [PATCH] Formatting --- event/common.go | 2 +- peer/cwtch_peer.go | 6 +++--- protocol/connections/engine.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/event/common.go b/event/common.go index 1b9843c..83fd20d 100644 --- a/event/common.go +++ b/event/common.go @@ -219,7 +219,7 @@ const ( Heartbeat = Type("Heartbeat") // Conversation Search - SearchResult = Type("SearchResult") + SearchResult = Type("SearchResult") SearchCancelled = Type("SearchCancelled") ) diff --git a/peer/cwtch_peer.go b/peer/cwtch_peer.go index b31a374..eaa66a2 100644 --- a/peer/cwtch_peer.go +++ b/peer/cwtch_peer.go @@ -805,9 +805,9 @@ func (cp *cwtchPeer) GetChannelMessage(conversation int, channel int, id int) (s } func (cp *cwtchPeer) doSearch(ctx context.Context, searchID string, pattern string) { - + // do not allow trivial searches that would match a wide variety of messages... - if len(pattern) <=5 { + if len(pattern) <= 5 { return } @@ -831,7 +831,7 @@ func (cp *cwtchPeer) doSearch(ctx context.Context, searchID string, pattern stri case <-ctx.Done(): cp.PublishEvent(event.NewEvent(event.SearchCancelled, map[event.Field]string{event.SearchID: searchID})) return - case <-time.After(time.Millisecond*100): + case <-time.After(time.Millisecond * 100): for _, conversation := range conversations { ccount := conversationCount[conversation.ID] if offset > ccount { diff --git a/protocol/connections/engine.go b/protocol/connections/engine.go index 6b29561..b9b7cac 100644 --- a/protocol/connections/engine.go +++ b/protocol/connections/engine.go @@ -344,7 +344,7 @@ func (e *engine) Shutdown() { log.Infof("shutting down ephemeral service") // work around: service.shutdown() can block for a long time if it is Open()ing a new connection, putting it in a // goroutine means we can perform this operation and let the per service shutdown in their own time or until the app exits - conn := connection; // don't capture loop variable + conn := connection // don't capture loop variable go func() { conn.connectingLock.Lock() conn.service.Shutdown()