MCPcopy Index your code
hub / github.com/1Panel-dev/1Panel / InitPingStatus

Function InitPingStatus

agent/init/firewall/firewall.go:127–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125}
126
127func InitPingStatus() {
128 global.LOG.Info("initializing ban ping status from settings...")
129 status := firewall.LoadPingStatus()
130 statusInDB, _ := repo.NewISettingRepo().GetValueByKey("BanPing")
131 if statusInDB == status {
132 return
133 }
134
135 enable := "1"
136 if statusInDB == constant.StatusDisable {
137 enable = "0"
138 }
139 if err := firewall.UpdatePingStatus(enable); err != nil {
140 global.LOG.Errorf("initialize ping status failed: %v", err)
141 }
142}

Callers 1

InitFunction · 0.85

Calls 1

GetValueByKeyMethod · 0.65

Tested by

no test coverage detected