Browse Source

set params in context

EUGENIO SOUZA CARVALHO 4 years ago
parent
commit
ab1e83dbe6
1 changed files with 5 additions and 4 deletions
  1. 5 4
      api/sse/hub.go

+ 5 - 4
api/sse/hub.go

@@ -245,10 +245,11 @@ reset:
 	for {
 		select {
 		case <-ticker5Second.C:
-			if !consuming {
-				hub.consume <- true
-			}
-		
+			go func ()  {
+				if !consuming {
+					hub.consume <- true
+				}	
+			}()
 		case <-hub.consume:
 			ctx.Application().Logger().Warnf("init.notification.loop 5s")
 			if count, redisErr = redis.Int(conn.Do("LLEN", channelId)); count == 0 || redisErr != nil {