Skip to content

Commit

Permalink
Issue #170: set version to status when appmanager recv install comman…
Browse files Browse the repository at this point in the history
…d from user, Compatibility with previous incorrect state settings when uninstall App
  • Loading branch information
weiqiushi committed Apr 13, 2023
1 parent c8de656 commit 314d358
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/service/app-manager/src/app_cmd_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ impl AppCmdExecutor {
error!("{}", err);
return Err(BuckyError::from((BuckyErrorCode::InvalidParam, err)));
}

status.lock().unwrap().set_version(&ver);

self.pre_change_status(
Expand Down Expand Up @@ -437,7 +438,7 @@ impl AppCmdExecutor {
{
let status = status.lock().unwrap();
web_id = status.web_dir().cloned();
ver = status.version().unwrap().to_owned();
ver = status.version().unwrap_or("noversion").to_owned();
}

let mut target_status_code = AppLocalStatusCode::Uninstalled;
Expand Down
3 changes: 3 additions & 0 deletions src/service/app-manager/src/app_manager_ex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,9 @@ impl AppManager {
cmd_code, status_code, next_status_code, app_id, cmd_group_code
);
status.set_status(next_status_code);
if let CmdCode::Install(install) = cmd_code {
status.set_version(&install.ver);
}
status_clone = status.clone();
}

Expand Down

0 comments on commit 314d358

Please sign in to comment.