mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 11:42:07 +00:00
* Update README.md * Add structured JSON production logging (#105) * Log requests and background failures (#107) * Document production logging and the VPS runbook
This commit is contained in:
Vendored
+7
-1
@@ -5,8 +5,13 @@ defmodule Chesstrainer.Cache.Persist do
|
||||
A backup is written to a temporary DETS file in the same directory and then
|
||||
atomically renamed into place. A crash during the write therefore leaves the
|
||||
previous backup untouched instead of a truncated file that fails to restore.
|
||||
|
||||
A backup that cannot be opened at boot is logged and skipped, so a damaged
|
||||
file does not stop the application from starting with an empty cache.
|
||||
"""
|
||||
|
||||
require Logger
|
||||
|
||||
@backup_path "priv/static/backups"
|
||||
@format_version "v2"
|
||||
|
||||
@@ -54,7 +59,8 @@ defmodule Chesstrainer.Cache.Persist do
|
||||
|
||||
:dets.close(table)
|
||||
|
||||
{:error, _} ->
|
||||
{:error, reason} ->
|
||||
Logger.warning("cache backup restore failed", table: table, reason: reason)
|
||||
:ok
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user