Function service cache partial support for multiple specialization (#332)
This adds partial support for multiple specialization to the function service cache. It allows Add() to succeed if the pod and address maps already contain entries. But it doesn't deal with DeletePod and TouchByAddress. That's ok for now, because the workflow engine never deletes the environment pod (that pod is the workflow engine). However, if/when we want full support for multiple specialization, that will require updating both DeletePod and TouchByAddress.
This commit is contained in:
Vendored
+1
-2
@@ -17,7 +17,6 @@ limitations under the License.
|
||||
package cache
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
@@ -114,7 +113,7 @@ func (c *Cache) service() {
|
||||
val := c.cache[req.key]
|
||||
val.atime = time.Now()
|
||||
resp.existingValue = val.value
|
||||
resp.error = errors.New("value already exists")
|
||||
resp.error = fission.MakeError(fission.ErrorNameExists, "key already exists")
|
||||
} else {
|
||||
c.cache[req.key] = &Value{
|
||||
value: req.value,
|
||||
|
||||
Reference in New Issue
Block a user