Skip to content

Instantly share code, notes, and snippets.

@jchapuis
Created August 12, 2024 17:54
Show Gist options
  • Save jchapuis/178308cb757229252e0f4a1823326ff1 to your computer and use it in GitHub Desktop.
Save jchapuis/178308cb757229252e0f4a1823326ff1 to your computer and use it in GitHub Desktop.
Safe update files
def safeUpdateIndexFiles(newFile: IndexPage.File) =
leaseRepository
.acquire(LeaseID(ks"file-uploader"), HolderID.unique)
.use(_.guard(updateIndexFiles(newFile)).map(_.embedError))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment