mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-25 01:10:54 +08:00
writeRemoteArchiveJournal ended with Sync on two directory handles. Windows cannot flush a directory handle, so the journal write failed there and no remote archive or remote deletion could start. Move the directory sync to syncDir: the unix build keeps the fsync, the other builds return nil (the journal file itself is already synced).
19 lines
340 B
Go
19 lines
340 B
Go
//go:build unix
|
|
|
|
package server
|
|
|
|
import (
|
|
"path/filepath"
|
|
"testing"
|
|
)
|
|
|
|
func TestSyncDir(t *testing.T) {
|
|
dir := t.TempDir()
|
|
if err := syncDir(dir); err != nil {
|
|
t.Fatalf("sync of an existing directory: %v", err)
|
|
}
|
|
if err := syncDir(filepath.Join(dir, "missing")); err == nil {
|
|
t.Fatal("sync of a missing directory must fail")
|
|
}
|
|
}
|