aboutsummaryrefslogtreecommitdiff
path: root/internal/persistence
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-05 18:16:47 -0400
committerhistoria <[not public]>2026-10-05 18:16:47 -0400
commit9d8c43cd68c960b9a6b8f781684f763e204a4498 (patch)
treec9e2a02094a8700db29db2768a0d058ce259a4f4 /internal/persistence
parent7a15a5d70004b28bf2a710fa0f536af2446e5b17 (diff)
downloadthehouseoficarus-9d8c43cd68c960b9a6b8f781684f763e204a4498.tar.gz
fix: shared YAML encoder and journal directory, text cleanup
Diffstat (limited to 'internal/persistence')
-rw-r--r--internal/persistence/txn.go7
1 files changed, 7 insertions, 0 deletions
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