forked from cwtch.im/cwtch
Formatting
This commit is contained in:
parent
b84de2aa61
commit
77e4e981e8
|
@ -219,7 +219,7 @@ const (
|
|||
Heartbeat = Type("Heartbeat")
|
||||
|
||||
// Conversation Search
|
||||
SearchResult = Type("SearchResult")
|
||||
SearchResult = Type("SearchResult")
|
||||
SearchCancelled = Type("SearchCancelled")
|
||||
)
|
||||
|
||||
|
|
|
@ -807,7 +807,7 @@ 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 {
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue