| 71 | } |
| 72 | |
| 73 | func (f *functionServerClient) GetAlias(input *api.GetAliasInput) (output *api.GetAliasOutput, hitCache bool, err error) { |
| 74 | if input.WithCache && input.FunctionBrn != "" { |
| 75 | v, ok := f.cache.Get(CacheKey(CacheTypeAlias, input.FunctionBrn)) |
| 76 | if ok { |
| 77 | output = v.(*api.GetAliasOutput) |
| 78 | hitCache = true |
| 79 | logs.Debugf("get function cache %s", input.FunctionBrn) |
| 80 | return |
| 81 | } |
| 82 | } |
| 83 | output, err = f.rpcClient.GetAlias(input) |
| 84 | if err != nil { |
| 85 | return |
| 86 | } |
| 87 | |
| 88 | if input.WithCache && input.FunctionBrn != "" { |
| 89 | f.cache.Set(CacheKey(CacheTypeAlias, input.FunctionBrn), output, f.cache.CacheExpiration(CacheTypeAlias)) |
| 90 | } |
| 91 | return |
| 92 | } |
| 93 | |
| 94 | func (f *functionServerClient) GetRuntimeConfiguration(input *api.GetRuntimeConfigurationInput) (conf *api.RuntimeConfiguration, hitCache bool, err error) { |
| 95 | v, ok := f.cache.Get(CacheKey(CacheTypeRuntime, input.RuntimeName)) |