package cron
import "zgo.at/goatcounter/v2/cron"
Package cron schedules jobs.
Index ¶
- Variables
- func DataRetention(ctx context.Context) error
- func EmailReports(ctx context.Context) error
- func PersistAndStat(ctx context.Context) error
- func ReindexStats(ctx context.Context, site goatcounter.Site, hits []goatcounter.Hit, tables []string) error
- func RunBackground(ctx context.Context)
- func UpdateStats(ctx context.Context, site *goatcounter.Site, siteID int64, hits []goatcounter.Hit) error
- type Task
Variables ¶
var Tasks = []Task{ {"persist hits", PersistAndStat, 10 * time.Second}, {"vacuum pageviews (data retention)", DataRetention, 1 * time.Hour}, {"renew ACME certs", renewACME, 2 * time.Hour}, {"vacuum soft-deleted sites", vacuumDeleted, 12 * time.Hour}, {"process scheduled plan changes", cancelPlan, 12 * time.Hour}, {"rm old exports", oldExports, 1 * time.Hour}, {"cycle sessions", sessions, 1 * time.Minute}, {"report usage", reportUsage, 12 * time.Hour}, {"send email reports", EmailReports, 1 * time.Hour}, }
Functions ¶
func DataRetention ¶
func EmailReports ¶
EmailReports sends email reports for sites that have this configured.
func PersistAndStat ¶
func ReindexStats ¶
func ReindexStats(ctx context.Context, site goatcounter.Site, hits []goatcounter.Hit, tables []string) error
ReindexStats re-indexes all the statistics for the given tables; this is intended to be run by the "goatcounter reindex" command.
func RunBackground ¶
RunBackground runs tasks in the background according to the given schedule.
func UpdateStats ¶
func UpdateStats(ctx context.Context, site *goatcounter.Site, siteID int64, hits []goatcounter.Hit) error
Types ¶
type Task ¶
func (Task) ID ¶
Source Files ¶
browser_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.2.2
- Published
- Feb 16, 2022
- Platform
- darwin/amd64
- Imports
- 24 packages
- Last checked
- 7 hours ago –
Tools for package owners.