main: save does not hang, just does not report save success #44

Merged
sb10q merged 1 commits from fix_save_hangs into master 2021-01-07 18:01:43 +08:00
1 changed files with 3 additions and 1 deletions

View File

@ -399,7 +399,9 @@ fn main() -> ! {
if channel.is_none() || channel == Some(c) {
let config = ChannelConfig::new(&mut channels, c);
match store.write_value(CHANNEL_CONFIG_KEY[c], &config, &mut store_value_buf) {
Ok(()) => {}
Ok(()) => {
send_line(&mut socket, b"{}");
}
Err(e) => {
error!("unable to save channel {} config to flash: {:?}", c, e);
let _ = writeln!(socket, "{{\"error\":\"{:?}\"}}", e);