summaryrefslogtreecommitdiff
path: root/internal/schedule/schedule.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/schedule/schedule.go')
-rw-r--r--internal/schedule/schedule.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/schedule/schedule.go b/internal/schedule/schedule.go
index 427c208..17c9588 100644
--- a/internal/schedule/schedule.go
+++ b/internal/schedule/schedule.go
@@ -13,12 +13,16 @@ var NothingToSchedule = errors.New("nothing to schedule")
func Run(args config.Args, platform string) (string, error) {
dir := fmt.Sprintf("%s/db/platforms/%s", args.GosDir, strings.ToLower(platform))
- stats, err := newStats(dir, args.Lookback)
+ stats, err := newStats(dir, args.Lookback, args.Target)
if err != nil {
return "", err
}
log.Println("For", platform, "stats:", stats)
+ if stats.targetHit() {
+ log.Println("Target hit, not posting at", platform)
+ return "", NothingToSchedule
+ }
return "", NothingToSchedule
}