def start

mylsm-lsm-store@0.6.0.1 · src/transfer/BackupIo.bend:252

import mylsm-lsm-store@0.6.0.1/src/transfer/BackupIo.bend as BackupIo
import Base
import mylsm-lsm-store@0.6.0.1/src/transfer/Backup.bend as Backup
import mylsm-lsm-store@0.6.0.1/src/Fs.bend as Fs

252# Stages a backup bundle and publishes it without replacing an existing path.
253def start(+destination: String, stream: Backup.Stream) -> IO(Result<&1, &1, Error, Unit>):
254  match stream:
255    case Backup.Stream{_, _, _, +block_count, _}:
256      +temporary = destination ++ ".backup-060.tmp"
257      do IO<Result<&1, &1, Error, Unit>>:
258        exists : Result<&1, &1, U32 & String, Bool> <- Fs.exists(path.clone(destination))
259        destination.checked(destination, temporary, exists, stream,
260          Backup.write_fuel(U32.to_nat(block_count)))

Uses (16)

Used by (1)