Skip to content

Commit

Permalink
comment cache until ttl implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen3H committed Apr 14, 2024
1 parent 91b3f27 commit 7e5b76e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions v1/community.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package v1

import (
"fmt"

"github.com/the-egg-corp/thundergo/util"
)

Expand All @@ -18,15 +19,15 @@ func (comm Community) AllPackages(predicate ...func(item Package, index int) boo
return nil, err
}

pkgCache = pkgs
//pkgCache = pkgs
return pkgs, nil
}

// Gets a single package from this community given the owner and package name.
func (comm Community) GetPackage(author string, name string) *Package {
if pkgCache != nil {
return pkgCache.Get(author, name)
}
// if pkgCache != nil {
// return pkgCache.Get(author, name)
// }

pkgs, err := comm.AllPackages()

Expand Down
2 changes: 1 addition & 1 deletion v1/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/the-egg-corp/thundergo/util"
)

var pkgCache PackageList
//var pkgCache PackageList

// An alias for a [Package] array with helper functions attached.
type PackageList []Package
Expand Down

0 comments on commit 7e5b76e

Please sign in to comment.