xapp-frame start to check more often is rmr ready, but log info only every 10 seconds. 92/1992/3 v0.0.23
authorJuha Hyttinen <juha.hyttinen@nokia.com>
Wed, 11 Dec 2019 07:29:12 +0000 (09:29 +0200)
committerJuha Hyttinen <juha.hyttinen@nokia.com>
Wed, 11 Dec 2019 07:38:50 +0000 (09:38 +0200)
Change-Id: I25e26acf47f2ca183072373e0fbd099f27b6d096
Signed-off-by: Juha Hyttinen <juha.hyttinen@nokia.com>
pkg/xapp/rmr.go

index 3cb4f84..3a52c97 100755 (executable)
@@ -111,13 +111,17 @@ func (m *RMRClient) Start(c MessageConsumer) {
                m.consumers = append(m.consumers, c)
        }
 
+       var counter int = 0
        for {
-               Logger.Info("rmrClient: Waiting for RMR to be ready ...")
-
                if m.ready = int(C.rmr_ready(m.context)); m.ready == 1 {
+                       Logger.Info("rmrClient: RMR is ready after %d seconds waiting...", counter)
                        break
                }
-               time.Sleep(10 * time.Second)
+               if counter%10 == 0 {
+                       Logger.Info("rmrClient: Waiting for RMR to be ready ...")
+               }
+               time.Sleep(1 * time.Second)
+               counter++
        }
        m.wg.Add(m.numWorkers)