MCPcopy
hub / github.com/argoproj/argo-cd / requestAppRefresh

Method requestAppRefresh

controller/appcontroller.go:971–988  ·  view source on GitHub ↗

requestAppRefresh adds a request for given app to the refresh queue. appName needs to be the qualified name of the application, i.e. / .

(appName string, compareWith *CompareWith, after *time.Duration)

Source from the content-addressed store, hash-verified

969// requestAppRefresh adds a request for given app to the refresh queue. appName
970// needs to be the qualified name of the application, i.e. <namespace>/<name>.
971func (ctrl *ApplicationController) requestAppRefresh(appName string, compareWith *CompareWith, after *time.Duration) {
972 key := ctrl.toAppKey(appName)
973
974 if compareWith != nil && after != nil {
975 ctrl.appComparisonTypeRefreshQueue.AddAfter(fmt.Sprintf("%s/%d", key, *compareWith), *after)
976 } else {
977 if compareWith != nil {
978 ctrl.refreshRequestedAppsMutex.Lock()
979 ctrl.refreshRequestedApps[key] = compareWith.Max(ctrl.refreshRequestedApps[key])
980 ctrl.refreshRequestedAppsMutex.Unlock()
981 }
982 if after != nil {
983 ctrl.appRefreshQueue.AddAfter(key, *after)
984 } else {
985 ctrl.appRefreshQueue.AddRateLimited(key)
986 }
987 }
988}
989
990func (ctrl *ApplicationController) isRefreshRequested(appName string) (bool, CompareWith) {
991 ctrl.refreshRequestedAppsMutex.Lock()

Calls 3

toAppKeyMethod · 0.95
LockMethod · 0.80
MaxMethod · 0.80

Tested by 4

TestNeedRefreshAppStatusFunction · 0.64
TestUpdateReconciledAtFunction · 0.64