mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
fix(performance): optimize performance for edge EE-3311 (#8040)
This commit is contained in:
parent
3d28a6f877
commit
dd0d1737b0
23 changed files with 577 additions and 164 deletions
26
api/internal/edge/cache/cache.go
vendored
Normal file
26
api/internal/edge/cache/cache.go
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
package cache
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/VictoriaMetrics/fastcache"
|
||||
portainer "github.com/portainer/portainer/api"
|
||||
)
|
||||
|
||||
var c = fastcache.New(1)
|
||||
|
||||
func key(k portainer.EndpointID) []byte {
|
||||
return []byte(strconv.Itoa(int(k)))
|
||||
}
|
||||
|
||||
func Set(k portainer.EndpointID, v []byte) {
|
||||
c.Set(key(k), v)
|
||||
}
|
||||
|
||||
func Get(k portainer.EndpointID) ([]byte, bool) {
|
||||
return c.HasGet(nil, key(k))
|
||||
}
|
||||
|
||||
func Del(k portainer.EndpointID) {
|
||||
c.Del(key(k))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue