Commit 4ed63205 authored by Erick Hitter's avatar Erick Hitter
Browse files

Don't run events we know we can't

Just a waste of resources, and next go around will capture these.
parent 23685173
......@@ -274,6 +274,14 @@ func getSiteEvents(site string) ([]Event, error) {
func runEvents(workerId int, events <-chan Event) {
for event := range events {
if now := time.Now(); event.Timestamp > int(now.Unix()) {
if debug {
logger.Printf("runEvents-%d skipping premature job %d|%s|%s for %s", workerId, event.Timestamp, event.Action, event.Instance, event.Url)
subcommand := []string{"cron-control", "orchestrate", "runner-only", "run", fmt.Sprintf("--timestamp=%d", event.Timestamp), fmt.Sprintf("--action=%s", event.Action), fmt.Sprintf("--instance=%s", event.Instance), fmt.Sprintf("--url=%s", event.Url)}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment