def close.failed.source
mylsm-lsm-store@0.6.0.1 · src/transfer/BackupOwnerCursorIo.bend:169
import mylsm-lsm-store@0.6.0.1/src/transfer/BackupOwnerCursorIo.bend as BackupOwnerCursorIo
import Base
import mylsm-lsm-store@0.6.0.1/src/coordinator/Client.bend as Client
import mylsm-lsm-store@0.6.0.1/src/coordinator/ByteClient.bend as ByteClient
import mylsm-lsm-store@0.6.0.1/src/transfer/BackupIo.bend as BackupIo
import mylsm-lsm-store@0.6.0.1/src/transfer/Backup.bend as Backup
169def close.failed.source(
170 file: File,
171 +temporary: String,
172 source: OwnerSource,
173 error: Backup.Error
174) -> IO(Result<&1, &1, BackupIo.Error, Unit>):
175 match source:
176 case OwnerSource{session, snapshot_id, cursor_id, cursor_live}:
177 match cursor_live:
178 case True{}:
179 do IO<Result<&1, &1, BackupIo.Error, Unit>>:
180 closed : Client.Session &
181 Result<&1, &1, Client.Error, Unit> <-
182 ByteClient.snapshot.cursor.close(session, cursor_id)
183 close.failed.cursor(file, temporary, snapshot_id,
184 error, closed)
185 case False{}:
186 close.failed.snapshot(file, temporary, session, snapshot_id, error)