add numberOfOnceSubscriptions func
@@ -9,6 +9,7 @@ import (
"fmt"
"io"
"io/ioutil"
+ "strings"
"sync"
"time"
@@ -256,3 +257,13 @@ func loadCerts(tlscfg *tls.Config, c *TargetConfig) error {
}
return nil
}
+
+func (t *Target) numberOfOnceSubscriptions() int {
+ num := 0
+ for _, sub := range t.Subscriptions {
+ if strings.ToUpper(sub.Mode) == "ONCE" {
+ num++
+ }
+ }
+ return num
+}
