From dce4c5e1d12093aeaa4be413caf38e62011735c5 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Thu, 5 Mar 2015 14:32:47 +0700 Subject: [PATCH] Config example --- config.example.json | 5 +++++ task/sync_contrib.go | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 config.example.json diff --git a/config.example.json b/config.example.json new file mode 100644 index 0000000..5e927e1 --- /dev/null +++ b/config.example.json @@ -0,0 +1,5 @@ +{ + "github_client_id": "XXXXXXXXXXXXXXXXXXXX", + "github_client_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "github_redirect_uri": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +} diff --git a/task/sync_contrib.go b/task/sync_contrib.go index 4e3276e..bcd0cba 100644 --- a/task/sync_contrib.go +++ b/task/sync_contrib.go @@ -29,7 +29,7 @@ func SyncContrib(t SyncContribTask) { continue } - res = append(res, &db.Contrib{ + contrib := &db.Contrib{ Week: week.Week.Time.Unix(), Author: *c.Author.Login, Owner: t.Owner, @@ -37,7 +37,8 @@ func SyncContrib(t SyncContribTask) { Commits: *week.Commits, Additions: *week.Additions, Deletions: *week.Deletions, - }) + } + contrib.Save() } } }