MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / init

Function init

internal/iplibrary/manager_ip_list.go:26–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24var IPListUpdateNotify = make(chan bool, 1)
25
26func init() {
27 if !teaconst.IsMain {
28 return
29 }
30
31 events.On(events.EventLoaded, func() {
32 goman.New(func() {
33 SharedIPListManager.Start()
34 })
35 })
36 events.OnClose(func() {
37 SharedIPListManager.Stop()
38 })
39
40 var ticker = time.NewTicker(24 * time.Hour)
41 goman.New(func() {
42 idles.RunTicker(ticker, func() {
43 SharedIPListManager.DeleteExpiredItems()
44 })
45 })
46}
47
48// IPListManager IP名单管理
49type IPListManager struct {

Callers

nothing calls this directly

Calls 7

OnFunction · 0.92
NewFunction · 0.92
OnCloseFunction · 0.92
RunTickerFunction · 0.92
StartMethod · 0.65
StopMethod · 0.65
DeleteExpiredItemsMethod · 0.65

Tested by

no test coverage detected