Skip to content

Followup fixes for #158#159

Open
YapingLi04 wants to merge 1 commit intocooperlees:mainfrom
YapingLi04:followup
Open

Followup fixes for #158#159
YapingLi04 wants to merge 1 commit intocooperlees:mainfrom
YapingLi04:followup

Conversation

@YapingLi04
Copy link
Contributor

This addresses @ikruglov's comments on #158.

Comment on lines +66 to 68
pub fn value_as_string(&self) -> Option<&str> {
self.value.as_str()
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still, value is a mandatory field in a metric. I think you should be able to remove Option<>. Maybe you can validate metric structure before parsing it

Comment on lines +192 to +193
crate::units::update_unit_stats(config_clone, sdc_clone, stats_clone)
.await
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you calling crate::units::update_unit_stats here and a couple of lines below. Maybe merge them.

pseudo code:

if (varlink_enabled) {
  call_varlink()
  if success
     return

  log("Fallback to DBus")
}

call_dbus()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants