Skip to content

Commit

Permalink
configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
John-LittleBearLabs committed Aug 11, 2023
1 parent f1f30eb commit b5c4a3a
Show file tree
Hide file tree
Showing 15 changed files with 218 additions and 346 deletions.
6 changes: 5 additions & 1 deletion config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ pub struct Config {
// A path to a directory which where files that appear should be auto-imported.
// Absence implies no such directory exists
pub watched_directory: Option<String>,

//How much storage space should Local Storage use? Measured in kiB. Default is 1 GiB
pub disk_usage: u64,
}

impl Default for Config {
Expand All @@ -53,11 +56,12 @@ impl Default for Config {
// Default to no set radio address
radio_address: None,
watched_directory: None,
disk_usage: 1024 * 1024,
}
}
}
fn default_storage_path() -> String {
dirs::cache_dir()
dirs::data_local_dir()
.and_then(|d: PathBuf| {
d.join("myceli")
.into_os_string()
Expand Down
3 changes: 2 additions & 1 deletion hyphae/src/myceli_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ impl MyceliApi {
}

fn send_msg(&self, msg: Message) -> Result<()> {
self.transport.send(msg, &self.address)
self.transport.send(msg, &self.address)?;
Ok(())
}

fn recv_msg(&self) -> Result<Message> {
Expand Down
Loading

0 comments on commit b5c4a3a

Please sign in to comment.