Skip to content
This repository was archived by the owner on Feb 4, 2021. It is now read-only.

Commit 3189540

Browse files
authored
Merge pull request #58 from gedorinku/fix_github_job
Fix GitHub job
2 parents bc11be5 + 83d1c14 commit 3189540

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

app/job/github_job.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"github.com/pkg/errors"
88
"github.com/shurcooL/githubv4"
99
"golang.org/x/oauth2"
10+
"google.golang.org/grpc/grpclog"
1011

1112
"github.com/ProgrammingLab/prolab-accounts/app/config"
1213
"github.com/ProgrammingLab/prolab-accounts/app/di"
@@ -60,7 +61,8 @@ func githubJob(ctx context.Context, store di.StoreComponent, cfg *config.Config)
6061
}
6162
gu, err := getGitHubUser(ctx, cli, name.String, from, to)
6263
if err != nil {
63-
return err
64+
grpclog.Errorf("github job: %v", err)
65+
continue
6466
}
6567

6668
err = storeGitHubContributions(ctx, store, u, gu)
@@ -108,6 +110,10 @@ func storeGitHubContributions(ctx context.Context, store di.StoreComponent, user
108110
}
109111
}
110112

113+
if l := len(days); contributionsFromDay < l {
114+
days = days[l-contributionsFromDay:]
115+
}
116+
111117
c := &model.GitHubContributionCollection{
112118
UserID: model.UserID(user.ID),
113119
TotalCount: int(github.User.ContributionsCollection.ContributionCalendar.TotalContributions),

infra/store/user/user_store.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ func (s *userStoreImpl) ListPublicUsers(minUserID model.UserID, limit int) ([]*r
109109
mods := []qm.QueryMod{
110110
qm.Load("Profile.Role"),
111111
qm.Load("Profile.Department"),
112-
qm.Select("profiles.*"),
113112
qm.InnerJoin("profiles on profiles.id = users.profile_id"),
114113
qm.Where("? <= users.id", minUserID),
115114
qm.Where("profiles.profile_scope = ?", model.Public),

0 commit comments

Comments
 (0)