Skip to content

Commit

Permalink
fix: add debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
0x2E committed Mar 8, 2024
1 parent 38fce1e commit 977a3fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ import (

// TODO: refactor all loggers
func main() {
go func() {
log.Println(http.ListenAndServe("localhost:6060", nil))
}()
if conf.Debug {
go func() {
log.Println(http.ListenAndServe("localhost:6060", nil))
}()
}

conf.Load()
repo.Init()

go pull.NewPuller(repo.NewFeed(repo.DB), repo.NewItem(repo.DB)).Run()

// TODO: pprof
api.Run()
}
2 changes: 2 additions & 0 deletions conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"github.com/spf13/viper"
)

const Debug = false

var Conf struct {
Host string `mapstructure:"HOST"`
Port int `mapstructure:"PORT"`
Expand Down

0 comments on commit 977a3fa

Please sign in to comment.