Skip to content

Commit

Permalink
debug: add more info
Browse files Browse the repository at this point in the history
  • Loading branch information
Neng Wan committed Oct 20, 2023
1 parent 8a33ff5 commit 616bf9a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ type Settings struct {
}

type dynamicConfig struct {
LogLevel harvestersync.String `seed:"DEBUG" flag:"loglevel"`
BlackListIPNetString harvestersync.String `seed:"" redis:"blacklist_ip_net" env:"BLACKLIST_IP_NET"`
WhiteListIPNetString harvestersync.String `seed:"192.168.0.0/24,10.0.0.0/8" redis:"whitelist_ip_net" env:"WHITELIST_IP_NET"`
BlackListUIDString harvestersync.String `seed:"123,456,789" redis:"blacklist_uid" env:"BLACKLIST_UID"`
Expand Down Expand Up @@ -224,11 +225,13 @@ func NewSettings() Settings {
Addr: s.RedisUrl,
Password: s.RedisAuth,
})
log.Println("DEBUG redis config: ", s.RedisUrl, s.RedisAuth)
fmt.Println("DEBUG redis config: ", s.RedisUrl, s.RedisAuth)

dc := dynamicConfig{}
h, err := harvester.New(&dc, chNotify,
harvester.WithRedisSeed(redisClient),
harvester.WithRedisMonitor(redisClient, 200*time.Millisecond),
harvester.WithRedisMonitor(redisClient, 1 * time.Minute),
)
if err != nil {
log.Fatalf("failed to create harvester: %v", err)
Expand Down

0 comments on commit 616bf9a

Please sign in to comment.