diff options
Diffstat (limited to 'internal/persistence')
| -rw-r--r-- | internal/persistence/txn.go | 7 |
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 |
