mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-09-30 21:42:05 +00:00
feat: make logging interval configurable
This commit is contained in:
parent
30bc87089c
commit
373044f289
5 changed files with 25 additions and 2 deletions
|
@ -140,7 +140,12 @@ func Serve(ctx *cli.Context) error {
|
|||
mostActiveIpMap := &sync.Map{}
|
||||
if cfg.Server.LogMostActiveIps {
|
||||
go func() {
|
||||
ticker := time.NewTicker(1 * time.Hour)
|
||||
interval := 1 * time.Hour
|
||||
if cfg.Server.LoggingInterval > 0 {
|
||||
interval = time.Duration(cfg.Server.LoggingInterval) * time.Second
|
||||
}
|
||||
|
||||
ticker := time.NewTicker(interval)
|
||||
for range ticker.C {
|
||||
type kv struct {
|
||||
Key string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue