mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
fix(sessions): periodically cleanup expired sessions (#1939)
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user