File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ func New(dir string) persistence.Section {
18
18
19
19
dirWithoutPathSep , _ := strings .CutSuffix (dir , string (os .PathSeparator ))
20
20
f .dir = fmt .Sprintf ("%s%c" , dirWithoutPathSep , os .PathSeparator )
21
+ _ = os .MkdirAll (f .dir , 600 )
21
22
22
23
f .load ()
23
24
@@ -44,7 +45,6 @@ func (f *file) Section(key ...string) persistence.Section {
44
45
45
46
if ! ok {
46
47
dir := fmt .Sprintf ("%s%s" , f .dir , key [0 ])
47
- _ = os .MkdirAll (dir , 600 )
48
48
49
49
s , _ = New (dir ).(* file )
50
50
f .sections [key [0 ]] = s
@@ -212,13 +212,14 @@ func (f *file) dirty() {
212
212
213
213
func (f * file ) dirtySync () {
214
214
f .m .Lock ()
215
- defer f .m .Unlock ()
216
215
217
216
if f .dirtyTimer != nil {
218
217
f .dirtyTimer .Stop ()
219
218
f .dirtyTimer = nil
220
219
}
221
220
221
+ f .m .Unlock ()
222
+
222
223
f .sync (false )
223
224
}
224
225
You can’t perform that action at this time.
0 commit comments