From e93f901db9c93458509c67922bd1db92fe5cd586 Mon Sep 17 00:00:00 2001 From: Anshal Shukla Date: Fri, 5 Apr 2024 13:08:45 +0530 Subject: [PATCH] handle: start after data dir deletion --- privval/file.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/privval/file.go b/privval/file.go index 5b8099a59f8..1f330ef30c6 100644 --- a/privval/file.go +++ b/privval/file.go @@ -237,6 +237,10 @@ func loadFilePV(keyFilePath, stateFilePath string, loadState bool) *FilePV { func LoadOrGenFilePV(keyFilePath, stateFilePath string) *FilePV { var pv *FilePV if cmtos.FileExists(keyFilePath) { + if !cmtos.FileExists(stateFilePath) { + pv = LoadFilePVEmptyState(keyFilePath, stateFilePath) + pv.Save() + } pv = LoadFilePV(keyFilePath, stateFilePath) } else { pv = GenFilePV(keyFilePath, stateFilePath)