Skip to content

Commit 92de3ed

Browse files
committed
proxy: notify fixes
1 parent b6dabab commit 92de3ed

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

proxy/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func DefaultProxySettings() *ProxySettings {
5353
ProxyWriteTimeout: 30 * time.Second,
5454
ProxyIdleTimeout: 5 * time.Minute,
5555
ProxyTlsHandshakeTimeout: 30 * time.Second,
56+
NotificationTimeout: 5 * time.Second,
5657
WarmupTimeout: 30 * time.Minute,
5758
}
5859
}

proxy/proxy_client_notification.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,15 @@ func (self *proxyClientNotification) run() {
4848
go server.HandleError(func() {
4949
defer self.cancel()
5050

51-
event, sub := server.Subscribe(self.ctx, model.ProxyClientChannel(proxyHost, block))
52-
defer sub()
51+
event, unsub := server.Subscribe(self.ctx, model.ProxyClientChannel(proxyHost, block))
52+
defer unsub()
5353

5454
for {
5555
select {
5656
case <-self.ctx.Done():
5757
return
5858
case <-event:
59+
glog.Infof("[proxy]notify\n")
5960
monitor.NotifyAll()
6061
}
6162
}
@@ -71,10 +72,10 @@ func (self *proxyClientNotification) run() {
7172
nextChangeId,
7273
)
7374
if err != nil {
74-
glog.Infof("[pcn]err=%s\n", err)
75+
glog.Infof("[proxy]err=%s\n", err)
7576
} else if 0 < len(proxyClients) {
7677

77-
glog.Infof("[pcn]found %d new proxy clients (%d..%d)\n", len(proxyClients), nextChangeId, maxChangeId)
78+
glog.Infof("[proxy]found %d new proxy clients (%d..%d)\n", len(proxyClients), nextChangeId, maxChangeId)
7879
self.proxyClients(maps.Values(proxyClients))
7980
}
8081
nextChangeId = maxChangeId + 1

0 commit comments

Comments
 (0)