File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -36,31 +36,27 @@ type Config struct {
36
36
}
37
37
38
38
func New (cfg Config ) candy.ProxyServer {
39
- ctx , cancel := context .WithCancel (context .Background ())
40
-
41
39
return & caddyServer {
42
40
cfg : cfg ,
43
41
apps : candy .NewAppService (candy.AppServiceConfig {
44
42
TLDs : cfg .TLDs ,
45
43
HostRoot : cfg .HostRoot ,
46
44
}),
47
- ctx : ctx ,
48
- cancel : cancel ,
49
45
}
50
46
}
51
47
52
48
type caddyServer struct {
49
+ ctx context.Context
53
50
cfg Config
54
51
apps * candy.AppService
55
52
56
53
caddyCfg * caddy.Config
57
54
caddyCfgMutex sync.Mutex
58
-
59
- ctx context.Context
60
- cancel context.CancelFunc
61
55
}
62
56
63
57
func (c * caddyServer ) Run (ctx context.Context ) error {
58
+ c .ctx = ctx
59
+
64
60
if err := c .startServer (); err != nil {
65
61
return err
66
62
}
You can’t perform that action at this time.
0 commit comments