Add comments to describe functions and types

This commit is contained in:
Fred Boniface
2024-03-29 14:01:57 +00:00
parent 2f5868e743
commit 8a94e51437
17 changed files with 36 additions and 2 deletions

View File

@@ -11,10 +11,12 @@ import (
const frequency = 3 * time.Second // Figure out a sensible frequency!
// Starts a background ticker to run background tasks. Uses the frequency configured in the background/ticker.go file
func InitTicker(cfg *helpers.Configuration, stop <-chan struct{}) {
go runTicker(cfg, stop)
}
// Runs the ticker and handles tick events
func runTicker(cfg *helpers.Configuration, stop <-chan struct{}) {
log.Msg.Sugar().Infof("Starting background ticker, runs every %s", frequency)
ticker := time.NewTicker(frequency)