package cron
import "zgo.at/goatcounter/v2/cron"
Package cron schedules jobs.
Index ¶
- Variables
- func SetPersistInterval(d time.Duration)
- func Start(ctx context.Context)
- func Stop() error
- func TaskACME() error
- func TaskDataRetention() error
- func TaskEmailReports() error
- func TaskOldExports() error
- func TaskPersistAndStat() error
- func TaskSessions() error
- func TaskVacuumOldSites() error
- func UpdateStats(ctx context.Context, site *goatcounter.Site, siteID int64, hits []goatcounter.Hit) error
- func WaitACME()
- func WaitDataRetention()
- func WaitEmailReports()
- func WaitOldExports()
- func WaitPersistAndStat()
- func WaitSessions()
- func WaitVacuumOldSites()
- type Task
Variables ¶
var Tasks = []Task{ {"vacuum pageviews (data retention)", dataRetention, 1 * time.Hour}, {"renew ACME certs", renewACME, 2 * time.Hour}, {"vacuum soft-deleted sites", vacuumDeleted, 12 * time.Hour}, {"rm old exports", oldExports, 1 * time.Hour}, {"cycle sessions", sessions, 1 * time.Minute}, {"send email reports", emailReports, 1 * time.Hour}, {"persist hits", persistAndStat, time.Duration(persistInterval.Load())}, }
Functions ¶
func SetPersistInterval ¶
func Start ¶
Start running tasks in the background.
func Stop ¶
func Stop() error
func TaskACME ¶
func TaskACME() error
func TaskDataRetention ¶
func TaskDataRetention() error
func TaskEmailReports ¶
func TaskEmailReports() error
func TaskOldExports ¶
func TaskOldExports() error
func TaskPersistAndStat ¶
func TaskPersistAndStat() error
func TaskSessions ¶
func TaskSessions() error
func TaskVacuumOldSites ¶
func TaskVacuumOldSites() error
func UpdateStats ¶
func UpdateStats(ctx context.Context, site *goatcounter.Site, siteID int64, hits []goatcounter.Hit) error
UpdateStats updates all the stats tables.
Exported for tests.
func WaitACME ¶
func WaitACME()
func WaitDataRetention ¶
func WaitDataRetention()
func WaitEmailReports ¶
func WaitEmailReports()
func WaitOldExports ¶
func WaitOldExports()
func WaitPersistAndStat ¶
func WaitPersistAndStat()
func WaitSessions ¶
func WaitSessions()
func WaitVacuumOldSites ¶
func WaitVacuumOldSites()
Types ¶
type Task ¶
func (Task) ID ¶
Source Files ¶
browser_stat.go campaign_stat.go cron.go email_reports.go hit_count.go hit_stat.go language_stat.go location_stat.go ref_count.go size_stat.go system_stat.go tasks.go
- Version
- v2.5.0 (latest)
- Published
- Dec 14, 2023
- Platform
- linux/amd64
- Imports
- 25 packages
- Last checked
- 1 day ago –
Tools for package owners.