fix(sessions): periodically cleanup expired sessions (#1939)

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
peusebiu
2023-10-17 06:03:42 +03:00
committed by GitHub
parent d60786c3b2
commit 7f6534a52d
7 changed files with 198 additions and 40 deletions
+9
View File
@@ -12,6 +12,7 @@ import (
)
type MockedImageStore struct {
NameFn func() string
DirExistsFn func(d string) bool
RootDirFn func() string
InitRepoFn func(name string) error
@@ -68,6 +69,14 @@ func (is MockedImageStore) RUnlock(t *time.Time) {
func (is MockedImageStore) RLock(t *time.Time) {
}
func (is MockedImageStore) Name() string {
if is.NameFn != nil {
return is.NameFn()
}
return ""
}
func (is MockedImageStore) DirExists(d string) bool {
if is.DirExistsFn != nil {
return is.DirExistsFn(d)