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)
| 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>. |
| 971 | func (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 | |
| 990 | func (ctrl *ApplicationController) isRefreshRequested(appName string) (bool, CompareWith) { |
| 991 | ctrl.refreshRequestedAppsMutex.Lock() |