mirror of
https://github.com/openziti/zrok.git
synced 2025-06-19 17:27:54 +02:00
enable snapshot streaming (#954)
This commit is contained in:
parent
0523b7484a
commit
3f95df780f
@ -70,7 +70,7 @@ func (cmd *testCanaryPublicProxy) run(_ *cobra.Command, _ []string) {
|
|||||||
logrus.Fatal("unable to load environment; did you 'zrok enable'?")
|
logrus.Fatal("unable to load environment; did you 'zrok enable'?")
|
||||||
}
|
}
|
||||||
|
|
||||||
var sc *canary.SnapshotCollector
|
var sc *canary.SnapshotStreamer
|
||||||
var scCtx context.Context
|
var scCtx context.Context
|
||||||
var scCancel context.CancelFunc
|
var scCancel context.CancelFunc
|
||||||
if cmd.canaryConfig != "" {
|
if cmd.canaryConfig != "" {
|
||||||
@ -79,7 +79,10 @@ func (cmd *testCanaryPublicProxy) run(_ *cobra.Command, _ []string) {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
scCtx, scCancel = context.WithCancel(context.Background())
|
scCtx, scCancel = context.WithCancel(context.Background())
|
||||||
sc = canary.NewSnapshotCollector(scCtx, cfg)
|
sc, err = canary.NewSnapshotStreamer(scCtx, cfg)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
go sc.Run()
|
go sc.Run()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,9 +130,9 @@ func (cmd *testCanaryPublicProxy) run(_ *cobra.Command, _ []string) {
|
|||||||
if sc != nil {
|
if sc != nil {
|
||||||
scCancel()
|
scCancel()
|
||||||
<-sc.Closed
|
<-sc.Closed
|
||||||
if err := sc.Store(); err != nil {
|
//if err := sc.Store(); err != nil {
|
||||||
panic(err)
|
// panic(err)
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
results := make([]*canary.LooperResults, 0)
|
results := make([]*canary.LooperResults, 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user