aboutsummaryrefslogtreecommitdiffstats
path: root/cache
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-29 20:58:22 +0200
committerMichael Muré <batolettre@gmail.com>2018-07-29 20:58:22 +0200
commitc58aa18a2d0683b0a1e6f0597724e67b500503a0 (patch)
tree06b7611ebce2a4cbe0c99f72729517cb8114e3f1 /cache
parent08f03ecf3cbbc350585acf0492966681ec449a94 (diff)
downloadgit-bug-c58aa18a2d0683b0a1e6f0597724e67b500503a0.tar.gz
graphql: lazy loading for the bug relay connection
Diffstat (limited to 'cache')
-rw-r--r--cache/cache.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cache/cache.go b/cache/cache.go
index 779b95b0..07c5be52 100644
--- a/cache/cache.go
+++ b/cache/cache.go
@@ -23,6 +23,7 @@ type Cacher interface {
type RepoCacher interface {
ResolveBug(id string) (BugCacher, error)
ResolveBugPrefix(prefix string) (BugCacher, error)
+ AllBugIds() ([]string, error)
ClearAllBugs()
}
@@ -155,6 +156,10 @@ func (c RepoCache) ResolveBugPrefix(prefix string) (BugCacher, error) {
return cached, nil
}
+func (c RepoCache) AllBugIds() ([]string, error) {
+ return bug.ListLocalIds(c.repo)
+}
+
func (c RepoCache) ClearAllBugs() {
c.bugs = make(map[string]BugCacher)
}