Skip to content

Commit

Permalink
Merge pull request ThreeDotsLabs#22 from maratori/data-race
Browse files Browse the repository at this point in the history
Fix data race
  • Loading branch information
roblaszczak authored Apr 5, 2021
2 parents 8e43771 + 8337e9d commit 8fa596b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion internal/common/server/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import (
"google.golang.org/grpc"
)

func init() {
grpc_logrus.ReplaceGrpcLogger(logrus.NewEntry(logrus.StandardLogger()))
}

func RunGRPCServer(registerServer func(server *grpc.Server)) {
port := os.Getenv("PORT")
if port == "" {
Expand All @@ -23,7 +27,6 @@ func RunGRPCServer(registerServer func(server *grpc.Server)) {

func RunGRPCServerOnAddr(addr string, registerServer func(server *grpc.Server)) {
logrusEntry := logrus.NewEntry(logrus.StandardLogger())
grpc_logrus.ReplaceGrpcLogger(logrusEntry)

grpcServer := grpc.NewServer(
grpc_middleware.WithUnaryServerChain(
Expand Down
2 changes: 1 addition & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ readonly service="$1"
readonly env_file="$2"

cd "./internal/$service"
env $(cat "../../.env" "../../$env_file" | grep -Ev '^#' | xargs) go test -count=1 -p=8 -parallel=8 ./...
env $(cat "../../.env" "../../$env_file" | grep -Ev '^#' | xargs) go test -count=1 -p=8 -parallel=8 -race ./...

0 comments on commit 8fa596b

Please sign in to comment.