Skip to content

Commit

Permalink
Fix fetch instance software version from nodeinfo (LemmyNet#3772)
Browse files Browse the repository at this point in the history
  • Loading branch information
shadone authored and Nutomic committed Aug 1, 2023
1 parent bf1b45b commit 8af716c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/scheduled_tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,13 @@ fn update_instance_software(conn: &mut PgConnection, user_agent: &str) -> LemmyR
Ok(res) => match res.json::<NodeInfo>() {
Ok(node_info) => {
// Instance sent valid nodeinfo, write it to db
let software = node_info.software.as_ref();
Some(
InstanceForm::builder()
.domain(instance.domain)
.updated(Some(naive_now()))
.software(node_info.software.and_then(|s| s.name))
.version(node_info.version.clone())
.software(software.and_then(|s| s.name.clone()))
.version(software.and_then(|s| s.version.clone()))
.build(),
)
}
Expand Down

0 comments on commit 8af716c

Please sign in to comment.