Skip to content

Commit

Permalink
Merge 46a861e into a7887c0
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Oct 10, 2019
2 parents a7887c0 + 46a861e commit 577e9cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hub/subscribe.go
Expand Up @@ -88,17 +88,17 @@ func (h *Hub) initSubscription(w http.ResponseWriter, r *http.Request) (*Subscri
authorizedAlltargets, authorizedTargets := authorizedTargets(claims, false)
subscriber := NewSubscriber(authorizedAlltargets, authorizedTargets, topics, rawTopics, templateTopics, retrieveLastEventID(r))

if subscriber.LastEventID != "" {
h.sendMissedEvents(w, r, subscriber)
}

// Create a new channel, over which the hub can send can send updates to this subscriber.
updateChan := make(chan *serializedUpdate)

// Add this client to the map of those that should
// receive updates
h.newSubscribers <- updateChan

if subscriber.LastEventID != "" {
h.sendMissedEvents(w, r, subscriber)
}

// Listen to the closing of the http connection via the CloseNotifier
notify := w.(http.CloseNotifier).CloseNotify()
go func() {
Expand Down

0 comments on commit 577e9cc

Please sign in to comment.