MCPcopy
hub / github.com/caddyserver/caddy / ClearLastConfigIfDifferent

Function ClearLastConfigIfDifferent

caddy.go:1273–1278  ·  view source on GitHub ↗

ClearLastConfigIfDifferent clears the recorded last-config if the provided source file/adapter do not match the recorded last-config. If both srcFile and srcAdapter are empty, the last-config is cleared.

(srcFile, srcAdapter string)

Source from the content-addressed store, hash-verified

1271// source file/adapter do not match the recorded last-config. If both srcFile
1272// and srcAdapter are empty, the last-config is cleared.
1273func ClearLastConfigIfDifferent(srcFile, srcAdapter string) {
1274 if (srcFile != "" || srcAdapter != "") && lastConfigMatches(srcFile, srcAdapter) {
1275 return
1276 }
1277 SetLastConfig("", "", nil)
1278}
1279
1280// getLastConfig returns the last-known config file and adapter.
1281func getLastConfig() (file, adapter string, fn reloadFromSourceFunc) {

Callers 1

handleConfigFunction · 0.85

Calls 2

lastConfigMatchesFunction · 0.85
SetLastConfigFunction · 0.85

Tested by

no test coverage detected