TG settlement service
This commit is contained in:
@@ -92,10 +92,23 @@ func (w *RegistryWatcher) consume(watcher nats.KeyWatcher) {
|
||||
if w == nil || watcher == nil {
|
||||
return
|
||||
}
|
||||
initial := true
|
||||
initialCount := 0
|
||||
for entry := range watcher.Updates() {
|
||||
if entry == nil {
|
||||
if initial && w.logger != nil {
|
||||
fields := []zap.Field{zap.Int("entries", initialCount)}
|
||||
if w.kv != nil {
|
||||
fields = append(fields, zap.String("bucket", w.kv.Bucket()))
|
||||
}
|
||||
w.logger.Info("Discovery registry watcher initial sync complete", fields...)
|
||||
initial = false
|
||||
}
|
||||
continue
|
||||
}
|
||||
if initial && entry.Operation() == nats.KeyValuePut {
|
||||
initialCount++
|
||||
}
|
||||
switch entry.Operation() {
|
||||
case nats.KeyValueDelete, nats.KeyValuePurge:
|
||||
key := registryKeyFromKVKey(entry.Key())
|
||||
|
||||
Reference in New Issue
Block a user