Skip to content

Commit af84b60

Browse files
log error in case of cache miss
1 parent 582adbf commit af84b60

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/sources/gitlab/gitlab.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package gitlab
22

33
import (
4+
"errors"
45
"fmt"
56
"net/url"
67
"os"
@@ -80,7 +81,7 @@ type Source struct {
8081
projectsPerPage int64
8182

8283
// cache of repo URL to project info, used when generating metadata for chunks
83-
*projectMetadataCache
84+
projectMetadataCache *projectMetadataCache
8485
}
8586

8687
// WithCustomContentWriter sets the useCustomContentWriter flag on the source.
@@ -248,6 +249,9 @@ func (s *Source) Init(ctx context.Context, name string, jobId sources.JobID, sou
248249
gitlabMetadata.ProjectId = project.id
249250
gitlabMetadata.ProjectName = project.name
250251
gitlabMetadata.ProjectOwner = project.owner
252+
} else {
253+
ctx.Logger().Error(errors.New("failed to get repo metadata from cache"),
254+
"cache miss: not found project metadata in the cache", "cache_key", repository)
251255
}
252256

253257
return &source_metadatapb.MetaData{

0 commit comments

Comments
 (0)