From 9d8c43cd68c960b9a6b8f781684f763e204a4498 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 5 Oct 2026 18:16:47 -0400 Subject: fix: shared YAML encoder and journal directory, text cleanup --- internal/persistence/txn.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'internal/persistence/txn.go') diff --git a/internal/persistence/txn.go b/internal/persistence/txn.go index 988af23..1babfc5 100644 --- a/internal/persistence/txn.go +++ b/internal/persistence/txn.go @@ -34,6 +34,13 @@ import ( // as a committed transaction that the next startup will roll back. const journalRemoveAttempts = 3 +// JournalDir returns the transaction journal directory under a data dir. Both +// the game and the admin API must use this so a future rename cannot leave one +// writer journaling to a directory startup recovery never scans. +func JournalDir(dataDir string) string { + return filepath.Join(dataDir, ".journal") +} + // journalVersion is the current journal schema version. Recover refuses a // version it does not understand rather than misreading a newer journal. const journalVersion = 1 -- cgit v1.2.3