Skip to content

Commit 72982a0

Browse files
Alec CunninghamAlec Cunningham
authored andcommitted
fix: config import errors
1 parent ef7bfc1 commit 72982a0

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

cmd/server/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
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"

pkg/config/config.go

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@ package config
22

33
import (
44
"log"
5+
"time"
56

67
"github.com/spf13/viper"
78
)
89

910
type 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

1719
type 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"),

pkg/db/db.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
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"

0 commit comments

Comments
 (0)