Skip to content

Commit

Permalink
Clarify storage logging messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
rgooch committed Mar 9, 2021
1 parent 4b355ef commit fdcdac6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cmd/keymasterd/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ func (state *RuntimeState) GetUsers() ([]string, bool, error) {
}
return dbMessage.Names, false, dbMessage.Err
case <-time.After(state.remoteDBQueryTimeout):
logger.Printf("GOT a timeout")
logger.Println("GetUsers: timed out on primary DB")
stmtText := getUsersStmt["sqlite"]
stmt, err := state.cacheDB.Prepare(stmtText)
if err != nil {
Expand All @@ -397,7 +397,7 @@ func (state *RuntimeState) GetUsers() ([]string, bool, error) {
if dbErr != nil {
logger.Printf("Problem with db = '%s'", err)
} else {
logger.Println("GOT data from db cache")
logger.Println("GetUsers: got data from DB cache")
}
return names, true, dbErr
}
Expand Down Expand Up @@ -465,7 +465,7 @@ func (state *RuntimeState) LoadUserProfile(username string) (
metricLogExternalServiceDuration("storage-read", time.Since(start))
profileBytes = dbMessage.ProfileBytes
case <-time.After(state.remoteDBQueryTimeout):
logger.Printf("GOT a timeout")
logger.Println("LoadUserProfile: timed out on primary DB")
fromCache = true
// load from cache
stmtText := loadUserProfileStmt["sqlite"]
Expand All @@ -486,7 +486,7 @@ func (state *RuntimeState) LoadUserProfile(username string) (
return nil, false, true, err
}
}
logger.Printf("GOT data from db cache")
logger.Println("LoadUserProfile: got data from DB cache")
}
logger.Debugf(10, "profile bytes len=%d", len(profileBytes))
//gobReader := bytes.NewReader(fileBytes)
Expand Down Expand Up @@ -645,7 +645,7 @@ func (state *RuntimeState) GetSigned(username string,
}
jwsData = dbMessage.JWSData
case <-time.After(state.remoteDBQueryTimeout):
logger.Printf("GOT a timeout")
logger.Println("GetSigned: timed out on primary DB")
// load from cache
stmtText := getSignedUserDataStmt["sqlite"]
stmt, err := state.cacheDB.Prepare(stmtText)
Expand All @@ -666,9 +666,9 @@ func (state *RuntimeState) GetSigned(username string,
return false, "", err
}
}
logger.Printf("GOT data from db cache")
logger.Println("GetSigned: got data from DB cache")
}
logger.Printf("GOT some jwsdata data")
logger.Println("GetSigned: got jwsdata")
storageJWT, err := state.getStorageDataFromStorageStringDataJWT(jwsData)
if err != nil {
logger.Debugf(2, "failed to get storage data %s data=%s", err, jwsData)
Expand Down

0 comments on commit fdcdac6

Please sign in to comment.