mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
refactor: move config to separate package
chore: load config from main method
This commit is contained in:
@@ -3,6 +3,7 @@ package services
|
||||
import (
|
||||
"crypto/md5"
|
||||
"errors"
|
||||
"github.com/muety/wakapi/config"
|
||||
"github.com/patrickmn/go-cache"
|
||||
"math"
|
||||
"sort"
|
||||
@@ -14,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
type SummaryService struct {
|
||||
Config *models.Config
|
||||
Config *config.Config
|
||||
Cache *cache.Cache
|
||||
Db *gorm.DB
|
||||
HeartbeatService *HeartbeatService
|
||||
@@ -23,7 +24,7 @@ type SummaryService struct {
|
||||
|
||||
func NewSummaryService(db *gorm.DB, heartbeatService *HeartbeatService, aliasService *AliasService) *SummaryService {
|
||||
return &SummaryService{
|
||||
Config: models.GetConfig(),
|
||||
Config: config.Get(),
|
||||
Cache: cache.New(24*time.Hour, 24*time.Hour),
|
||||
Db: db,
|
||||
HeartbeatService: heartbeatService,
|
||||
|
Reference in New Issue
Block a user