Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rudderlabs/rudder-server
Browse files Browse the repository at this point in the history
  • Loading branch information
psrikanth88 committed Nov 6, 2019
2 parents 115d7bb + fcceb76 commit cf9c89f
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ ALERT_PROVIDER=pagerduty
PG_ROUTING_KEY=<your_integration/routing_key>

# Alerting VictorOps Config
#ALERT_PROVIDER="victorops"
#ALERT_PROVIDER=victorops
#VICTOROPS_ROUTING_KEY=<your_victorops_routing_key>
17 changes: 17 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <overrides_existing_version>" >&2
exit 1
fi

read -p "Are you sure to release? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
git tag -d $1
git push origin :refs/tags/$1

git tag -a $1 -m "Release $1"
git push origin $1

goreleaser --rm-dist
fi
12 changes: 10 additions & 2 deletions services/source-debugger/source-debugger.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ func uploadEvents(eventBuffer []*EventSchemaT) {
for _, event := range eventBuffer {
batchedEvent := EventT{}
err := json.Unmarshal([]byte(event.eventBatch), &batchedEvent)
misc.AssertError(err)
if err != nil {
logger.Debugf(string(event.eventBatch))
misc.AssertErrorIfDev(err)
continue
}

receivedAtTS, err := time.Parse(time.RFC3339, batchedEvent.ReceivedAt)
if err != nil {
Expand Down Expand Up @@ -140,7 +144,11 @@ func uploadEvents(eventBuffer []*EventSchemaT) {
}

rawJSON, err := json.Marshal(res)
misc.AssertError(err)
if err != nil {
logger.Debugf(string(rawJSON))
misc.AssertErrorIfDev(err)
return
}

tr := &http.Transport{}
client := &http.Client{Transport: tr}
Expand Down
15 changes: 15 additions & 0 deletions utils/misc/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ func AssertError(err error) {
}
}

func AssertErrorIfDev(err error) {

goEnv := os.Getenv("GO_ENV")
if goEnv == "production" {
return
}

if err != nil {
// debug.SetTraceback("all")
debug.PrintStack()
defer bugsnag.AutoNotify()
panic(err)
}
}

//Assert panics if false
func Assert(cond bool) {
if !cond {
Expand Down

0 comments on commit cf9c89f

Please sign in to comment.