This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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