Formatting
continuous-integration/drone/pr Build is pending
Details
continuous-integration/drone/pr Build is pending
Details
This commit is contained in:
parent
b84de2aa61
commit
77e4e981e8
|
@ -219,7 +219,7 @@ const (
|
||||||
Heartbeat = Type("Heartbeat")
|
Heartbeat = Type("Heartbeat")
|
||||||
|
|
||||||
// Conversation Search
|
// Conversation Search
|
||||||
SearchResult = Type("SearchResult")
|
SearchResult = Type("SearchResult")
|
||||||
SearchCancelled = Type("SearchCancelled")
|
SearchCancelled = Type("SearchCancelled")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
func (cp *cwtchPeer) doSearch(ctx context.Context, searchID string, pattern string) {
|
||||||
|
|
||||||
// do not allow trivial searches that would match a wide variety of messages...
|
// do not allow trivial searches that would match a wide variety of messages...
|
||||||
if len(pattern) <=5 {
|
if len(pattern) <= 5 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -831,7 +831,7 @@ func (cp *cwtchPeer) doSearch(ctx context.Context, searchID string, pattern stri
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
cp.PublishEvent(event.NewEvent(event.SearchCancelled, map[event.Field]string{event.SearchID: searchID}))
|
cp.PublishEvent(event.NewEvent(event.SearchCancelled, map[event.Field]string{event.SearchID: searchID}))
|
||||||
return
|
return
|
||||||
case <-time.After(time.Millisecond*100):
|
case <-time.After(time.Millisecond * 100):
|
||||||
for _, conversation := range conversations {
|
for _, conversation := range conversations {
|
||||||
ccount := conversationCount[conversation.ID]
|
ccount := conversationCount[conversation.ID]
|
||||||
if offset > ccount {
|
if offset > ccount {
|
||||||
|
|
|
@ -344,7 +344,7 @@ func (e *engine) Shutdown() {
|
||||||
log.Infof("shutting down ephemeral service")
|
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
|
// 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
|
// 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() {
|
go func() {
|
||||||
conn.connectingLock.Lock()
|
conn.connectingLock.Lock()
|
||||||
conn.service.Shutdown()
|
conn.service.Shutdown()
|
||||||
|
|
Loading…
Reference in New Issue