Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	doc/version.go
  • Loading branch information
TheFireMike committed Jan 4, 2021
2 parents 8af2e45 + 51bc24e commit 4f8f848
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 9 additions & 3 deletions core/request/get_communicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,23 @@ func GetCommunicator(ctx context.Context, baseRequest BaseRequest) (communicator
deviceProperties, err := db.GetDeviceProperties(ctx, baseRequest.DeviceData.IPAddress)
if err != nil {
if !tholaerr.IsNotFoundError(err) {
log.Ctx(ctx).Error().Err(err).Msg("failed to get connection data from cache")
return nil, errors.Wrap(err, "failed to get connection data from cache")
log.Ctx(ctx).Error().Err(err).Msg("failed to get device properties from cache")
return nil, errors.Wrap(err, "failed to get device properties from cache")
}
log.Ctx(ctx).Trace().Msg("no device properties found in cache")
invalidCache = true
} else {
log.Ctx(ctx).Trace().Msg("found device properties in cache, starting to validate")
res, err := communicator.MatchDeviceClass(ctx, deviceProperties.Class)
if err != nil {
log.Ctx(ctx).Error().Err(err).Msg("failed to match device class")
return nil, errors.Wrap(err, "failed to match device class")
}
invalidCache = !res
if invalidCache = !res; invalidCache {
log.Ctx(ctx).Trace().Msg("cached device class is invalid")
} else {
log.Ctx(ctx).Trace().Msg("cached device class is valid")
}
}
if invalidCache {
identifyRequest := IdentifyRequest{BaseRequest: baseRequest}
Expand Down
2 changes: 2 additions & 0 deletions doc/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@
//
// swagger:meta
package doc

const Version = "v0.1.2"

0 comments on commit 4f8f848

Please sign in to comment.