File tree Expand file tree Collapse file tree 3 files changed +13
-9
lines changed
Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 66 "os/signal"
77 "syscall"
88
9+ "github.com/moosh3/github-actions-aggregator/pkg/config"
910 "github.com/moosh3/github-actions-aggregator/pkg/github"
1011 "github.com/mooshe3/github-actions-aggregator/pkg/api"
11- "github.com/mooshe3/github-actions-aggregator/pkg/config"
1212 "github.com/mooshe3/github-actions-aggregator/pkg/db"
1313 "github.com/mooshe3/github-actions-aggregator/pkg/logger"
1414 "github.com/mooshe3/github-actions-aggregator/pkg/worker"
Original file line number Diff line number Diff line change @@ -2,16 +2,18 @@ package config
22
33import (
44 "log"
5+ "time"
56
67 "github.com/spf13/viper"
78)
89
910type Config struct {
10- ServerPort string
11- LogLevel string
12- EnablePolling bool
13- Database DatabaseConfig
14- GitHub GitHubConfig
11+ ServerPort string
12+ LogLevel string
13+ EnablePolling bool
14+ PollingInterval time.Duration
15+ Database DatabaseConfig
16+ GitHub GitHubConfig
1517}
1618
1719type GitHubConfig struct {
@@ -46,8 +48,10 @@ func LoadConfig() *Config {
4648 }
4749
4850 return & Config {
49- ServerPort : viper .GetString ("server.port" ),
50- LogLevel : viper .GetString ("log.level" ),
51+ ServerPort : viper .GetString ("server.port" ),
52+ LogLevel : viper .GetString ("log.level" ),
53+ EnablePolling : viper .GetBool ("polling.enabled" ),
54+ PollingInterval : viper .GetDuration ("polling.interval" ),
5155 GitHub : GitHubConfig {
5256 ClientID : viper .GetString ("github.client_id" ),
5357 ClientSecret : viper .GetString ("github.client_secret" ),
Original file line number Diff line number Diff line change 44 "fmt"
55
66 "github.com/google/go-github/v50/github"
7- "github.com/moosh3/github-actions-aggregator/pkg/config"
7+ config "github.com/moosh3/github-actions-aggregator/pkg/config"
88 "github.com/moosh3/github-actions-aggregator/pkg/db/models"
99 "gorm.io/driver/postgres"
1010 "gorm.io/gorm"
You can’t perform that action at this time.
0 commit comments