func main() { | |
c := cron.New() | |
c.AddFunc("@every 30s", func() { | |
url = os.Getenv("SYNTHETIC_URL") | |
apitoken = os.Getenv("SYNTHETIC_API_TOKEN") | |
result := syn.SyntheticHttpRequest(url, apitoken) | |
if result == syn.ConnectionError { | |
datadog.ReportConnectionError() | |
} else if result == syn.UnexpectedResponse { | |
datadog.ReportUnexpectedResponse() | |
} else { | |
datadog.ReportOK() | |
} | |
}) | |
c.Start() | |
// Keep the process from exiting | |
d := make(chan string) | |
<-d | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment