Skip to content

Commit

Permalink
Merge pull request #1740 from afumagalli98/improve-missing-db
Browse files Browse the repository at this point in the history
Added unlisted running dbs to missing db API
  • Loading branch information
afumagalli98 authored Mar 6, 2024
2 parents 5f4d151 + d667c49 commit 0a388df
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion api-service/service/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,17 @@ func (as *APIService) DismissHost(hostname string) error {
}

func (as *APIService) IsMissingDB(hostname string) ([]string, error) {
return as.Database.FindUnretrievedDatabases(hostname)
unlisted, err := as.Database.FindUnlistedRunningDatabases(hostname)
if err != nil {
return nil, err
}

unretrieved, err := as.Database.FindUnretrievedDatabases(hostname)
if err != nil {
return nil, err
}

return append(unlisted, unretrieved...), nil
}

func checkHosts(as *APIService, hosts []string) error {
Expand Down
1 change: 1 addition & 0 deletions api-service/service/hosts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ func TestGetHostDataSummaries(t *testing.T) {

if tc.res != nil {
db.EXPECT().FindUnretrievedDatabases("pluto").Return(nil, nil).Times(1)
db.EXPECT().FindUnlistedRunningDatabases("pluto").Return(nil, nil).Times(1)
}

res, err := as.GetHostDataSummaries(tc.filters)
Expand Down

0 comments on commit 0a388df

Please sign in to comment.