From 8ff18459ba924f6b7dd4a63d6823d18e9d6d5b3a Mon Sep 17 00:00:00 2001 From: seamory Date: Mon, 30 May 2022 13:53:09 +0800 Subject: [PATCH] - Fix the issue not create DateItem when calling Create function. --- .gitignore | 1 + store.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 9e95391..1f44660 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ .glide/ .vscode +.idea/ diff --git a/store.go b/store.go index bc5dbed..c13d5ea 100644 --- a/store.go +++ b/store.go @@ -128,6 +128,9 @@ func (s *memoryStore) Check(_ context.Context, sid string) (bool, error) { } func (s *memoryStore) Create(ctx context.Context, sid string, expired int64) (Store, error) { + item := newDataItem(sid, nil, expired) + s.data[sid] = item + s.list.PushBack(item) return newStore(ctx, s, sid, expired, nil), nil }