This commit is contained in:
cdle
2023-06-14 15:01:14 +08:00
parent cf310e5ef7
commit da24a7ab97
6 changed files with 282 additions and 0 deletions
+3
View File
@@ -40,6 +40,9 @@ func (s *PersistentKeyValueStore) Set(key string, value interface{}, dur int) er
ExpiredAt: expiredAt,
}
go func() {
defer func() {
recover()
}()
jsonBytes, err := json.Marshal(s.data)
if err == nil {
ioutil.WriteFile(tempPath, jsonBytes, 0644)