Skip to content

Commit

Permalink
add some logs
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Feb 22, 2024
1 parent 58deac3 commit ec42bc4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ghdb/ghdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func (db *ErrDB) checkUpdate() error {
func (db *ErrDB) RefreshCache() (err error) {
if db.cachedVersion == (versionData{}) {
version := db.Cache.Get("version")
println("Unmarshaling version", version)
json.Unmarshal(([]byte)(version), &db.cachedVersion)
}
newVersion, err := db.fetchGhDBVersion()
Expand Down Expand Up @@ -150,6 +151,7 @@ func (db *ErrDB) GetErrorDesc(id int) (desc *mcla.ErrorDesc, err error) {
return
}
desc = new(mcla.ErrorDesc)
println("Unmarshaling error", id, buf)
if err = json.Unmarshal(([]byte)(buf), desc); err != nil {
db.Cache.Remove(cacheKey)
desc = nil
Expand Down Expand Up @@ -206,6 +208,7 @@ func (db *ErrDB) GetSolution(id int) (sol *mcla.SolutionDesc, err error) {
return
}
sol = new(mcla.SolutionDesc)
println("Unmarshaling solution", id, buf)
if err = json.Unmarshal(([]byte)(buf), sol); err != nil {
db.Cache.Remove(cacheKey)
sol = nil
Expand Down

0 comments on commit ec42bc4

Please sign in to comment.