Skip to content

Commit

Permalink
feat(async): use is_async_compatible() to determine backend incompa…
Browse files Browse the repository at this point in the history
…tibility and error out (#1355)

Use `getters` to early exit webdav when using `async_incompatible`
backends.

Using the type system or fixing all async compatibility issue is big and
structural work.
To avoid runtime crash for our users I suggest using this getter as a
temporary fix.

tracking issue: #1181 (see for
more details)

> As far as I could tell, `webdav` feature was the only one spawning a
`runtime` in `rustic` and using it.

### Before merging this one:
- [x] rustic_core (core and backend) must be updated to a release that
includes rustic-rs/rustic_core#355.

---------

Co-authored-by: simonsan <[email protected]>
  • Loading branch information
nardoor and simonsan authored Nov 21, 2024
1 parent ae6f258 commit c3e2557
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/commands/webdav.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ impl WebDavCmd {
fn inner_run(&self, repo: CliIndexedRepo) -> Result<()> {
let config = RUSTIC_APP.config();

// webdav only works with async compatible repo
if !repo.is_async_compatible() {
return Err(anyhow!("Webdav is currently incompatible with the backend you are using. See https://github.com/rustic-rs/rustic/issues/1181 for more details."));
}

let path_template = config
.webdav
.path_template
Expand Down

0 comments on commit c3e2557

Please sign in to comment.