mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 23:51:25 +08:00
change: group environments
This commit is contained in:
@@ -2,13 +2,13 @@ package sdk
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/denisbrodbeck/machineid"
|
||||
"github.com/getsentry/sentry-go"
|
||||
"github.com/google/uuid"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"github.com/httprunner/httprunner/v4/hrp/internal/env"
|
||||
"github.com/httprunner/httprunner/v4/hrp/internal/version"
|
||||
)
|
||||
|
||||
@@ -29,7 +29,7 @@ func init() {
|
||||
gaClient = NewGAClient(trackingID, clientID)
|
||||
|
||||
// init sentry sdk
|
||||
if os.Getenv("DISABLE_SENTRY") == "true" {
|
||||
if env.DISABLE_SENTRY == "true" {
|
||||
return
|
||||
}
|
||||
err = sentry.Init(sentry.ClientOptions{
|
||||
@@ -50,7 +50,7 @@ func init() {
|
||||
}
|
||||
|
||||
func SendEvent(e IEvent) error {
|
||||
if os.Getenv("DISABLE_GA") == "true" {
|
||||
if env.DISABLE_GA == "true" {
|
||||
// do not send GA events in CI environment
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user