|
@@ -168,6 +168,15 @@ func runMessageQueue(wg *sync.WaitGroup, ctx context.Context) {
|
|
defer wg.Done()
|
|
defer wg.Done()
|
|
go mq.Keepalive(ctx)
|
|
go mq.Keepalive(ctx)
|
|
defer mq.CloseClient()
|
|
defer mq.CloseClient()
|
|
|
|
+ go func() {
|
|
|
|
+ st := time.Second * 30
|
|
|
|
+ for {
|
|
|
|
+ time.Sleep(st)
|
|
|
|
+ logger.Log(0, "-----------> $$$$$$$ Restting MQ CONN")
|
|
|
|
+ mq.ResetCh <- struct{}{}
|
|
|
|
+ st = time.Second * 5
|
|
|
|
+ }
|
|
|
|
+ }()
|
|
for {
|
|
for {
|
|
brokerHost, _ := servercfg.GetMessageQueueEndpoint()
|
|
brokerHost, _ := servercfg.GetMessageQueueEndpoint()
|
|
logger.Log(0, "connecting to mq broker at", brokerHost)
|
|
logger.Log(0, "connecting to mq broker at", brokerHost)
|
|
@@ -179,6 +188,7 @@ func runMessageQueue(wg *sync.WaitGroup, ctx context.Context) {
|
|
}
|
|
}
|
|
select {
|
|
select {
|
|
case <-mq.ResetCh:
|
|
case <-mq.ResetCh:
|
|
|
|
+ logger.Log(0, "\n\n$$$$$$$-------> Resetting MQ----------------> \n\n")
|
|
mq.CloseClient()
|
|
mq.CloseClient()
|
|
time.Sleep(time.Second * 2)
|
|
time.Sleep(time.Second * 2)
|
|
continue
|
|
continue
|