]> git.giacomolli.uk - onechat/blobdiff - log.go
Replay a synthetic log through the core
[onechat] / log.go
diff --git a/log.go b/log.go
index 7b8d5126ec2659db6b9598d245a86b1f5acb5b9b..f1727d5fafef4e3dc35c42df94c9986f0b515aec 100644 (file)
--- a/log.go
+++ b/log.go
@@ -38,11 +38,11 @@ type Message struct {
 
 // Log is the append-only message log of one chat. It writes one JSON line for
 // each message to main/YYYY-MM-DD.jsonl, named for the local day of the write.
 
 // Log is the append-only message log of one chat. It writes one JSON line for
 // each message to main/YYYY-MM-DD.jsonl, named for the local day of the write.
-// It never edits or deletes a line. Each write goes to the file and to the disk
-// before Append returns. An exclusive lock on the lock file makes sure that
-// only one process writes the log. After a failed write, the end of the file is
-// not known, so the log refuses all writes until it is opened again. The caller
-// serializes all calls.
+// It never edits or deletes a line. Each line goes to the operating system
+// before Append returns, so a crash of the process loses no message. An
+// exclusive lock on the lock file makes sure that only one process writes the
+// log. After a failed write, the end of the file is not known, so the log
+// refuses all writes until it is opened again. The caller serializes all calls.
 type Log struct {
        clock    func() time.Time
        lock     *os.File
 type Log struct {
        clock    func() time.Time
        lock     *os.File