mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 23:51:25 +08:00
feat: disable GA events report by setting environment DISABLE_GA=true
This commit is contained in:
@@ -2,6 +2,7 @@ package sdk
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/denisbrodbeck/machineid"
|
||||
"github.com/getsentry/sentry-go"
|
||||
@@ -46,5 +47,9 @@ func init() {
|
||||
}
|
||||
|
||||
func SendEvent(e IEvent) error {
|
||||
if os.Getenv("DISABLE_GA") == "true" {
|
||||
// do not send GA events in CI environment
|
||||
return nil
|
||||
}
|
||||
return gaClient.SendEvent(e)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user