def wal.present

mylsm-lsm-store@0.6.0.1 · src/transfer/MigrateIo.bend:616

import mylsm-lsm-store@0.6.0.1/src/transfer/MigrateIo.bend as MigrateIo
import Base
import mylsm-lsm-store@0.6.0.1/src/DbLock.bend as DbLock
import mylsm-lsm-store@0.6.0.1/src/Fs.bend as Fs

616# Treats a missing WAL as an empty legacy mutation stream.
617def wal.present(
618  lock: DbLock.Lock,
619  present: Bool,
620  +path: String
621) -> IO(Result<&1, &1, Error, Nat>):
622  match present:
623    case False{}: release(lock, Done{0n}, path)
624    case True{}:
625      do IO<Result<&1, &1, Error, Nat>>:
626        size : Result<&1, &1, U32 & String, Nat> <- Fs.file_size(path ++ "/WAL")
627        wal.size.result(lock, size, path)

Uses (14)

Used by (1)