Skip to content

Commit

Permalink
Reduce cache expiry
Browse files Browse the repository at this point in the history
Reduce cache expiry to help support issues where a function
may be scaled down by a user, when it is still in use.

The 5s cache meant that all requests would fail until the
expiry. The 250ms setting is a 20x reduction.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Feb 26, 2021
1 parent 4bdb580 commit 048a90a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gateway/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func main() {
MaxPollCount: uint(1000),
SetScaleRetries: uint(20),
FunctionPollInterval: time.Millisecond * 100,
CacheExpiry: time.Second * 5, // freshness of replica values before going stale
CacheExpiry: time.Millisecond * 250, // freshness of replica values before going stale
ServiceQuery: externalServiceQuery,
}

Expand Down

0 comments on commit 048a90a

Please sign in to comment.