File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 2727 }
2828)
2929
30+ var SentryTimeout = 30 * time .Second
31+
3032// newReporter creates a new Sentry client
3133func newReporter (cr * CmdRequest ) (* Reporter , error ) {
3234 sentryDSN , ok := os .LookupEnv ("CRONGUARD_SENTRY_DSN" )
@@ -53,8 +55,7 @@ func newReporter(cr *CmdRequest) (*Reporter, error) {
5355
5456 // setup sentry
5557 sentryErr := sentry .Init (sentry.ClientOptions {
56- Dsn : sentryDSN ,
57- Transport : sentry .NewHTTPSyncTransport (),
58+ Dsn : sentryDSN ,
5859 })
5960 if sentryErr != nil {
6061 fmt .Fprintf (cr .Status .Stderr , "cronguard: unable to connect to sentry: %s\n " , sentryErr )
@@ -104,9 +105,9 @@ type reportLevel = string
104105
105106const (
106107 // infoLevel is an information that will be send to sentry
107- infoLevel reportLevel = "info"
108+ infoLevel reportLevel = "info"
108109 // finishLevel is used to tell the reporter that the cron has finished
109- finishLevel = "finish"
110+ finishLevel = "finish"
110111)
111112
112113// report reports any error message to sentry
@@ -133,7 +134,7 @@ func (r *Reporter) report(err error, level reportLevel) error {
133134 _ = sentry .CaptureMessage (name )
134135
135136 // hide error if messages are successfully flushed to sentry
136- flushed := sentry .Flush (30 * time . Second )
137+ flushed := sentry .Flush (SentryTimeout )
137138 if ! flushed {
138139 return err
139140 }
You can’t perform that action at this time.
0 commit comments