Pods immediately terminate for idletimeout in new deployment and container executer type (#2459)
* added waitgroup to handle multiple goroutine scenario * changes for cache service * changes to get function service from cache by UID
This commit is contained in:
@@ -130,10 +130,16 @@ func (fsc *FunctionServiceCache) service() {
|
||||
resp.error = fsc._touchByAddress(req.address)
|
||||
case LISTOLD:
|
||||
// get svcs idle for > req.age
|
||||
fscs := fsc.byFunction.Copy()
|
||||
fscs := fsc.byFunctionUID.Copy()
|
||||
funcObjects := make([]*FuncSvc, 0)
|
||||
for _, funcSvc := range fscs {
|
||||
fsvc := funcSvc.(*FuncSvc)
|
||||
mI := funcSvc.(metav1.ObjectMeta)
|
||||
fsvcI, err := fsc.byFunction.Get(crd.CacheKey(&mI))
|
||||
if err != nil {
|
||||
fsc.logger.Error("error while getting service", zap.Any("error", err))
|
||||
return
|
||||
}
|
||||
fsvc := fsvcI.(*FuncSvc)
|
||||
if time.Since(fsvc.Atime) > req.age {
|
||||
funcObjects = append(funcObjects, fsvc)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user