Skip to content

Commit

Permalink
ensure waiting gRPC calls aren't notified before context is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Hades32 committed May 8, 2022
1 parent 355cc56 commit a38c460
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/sdkserver/sdkserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ func (s *SDKServer) Run(ctx context.Context) error {
if !cache.WaitForCacheSync(ctx.Done(), s.gameServerSynced) {
return errors.New("failed to wait for caches to sync")
}

// need this for streaming gRPC commands
s.ctx = ctx
// we have the gameserver details now
s.gsWaitForSync.Done()

Expand All @@ -207,8 +210,6 @@ func (s *SDKServer) Run(ctx context.Context) error {
return err
}

// need this for streaming gRPC commands
s.ctx = ctx
logLevel := agonesv1.SdkServerLogLevelInfo
// grab configuration details
if gs.Spec.SdkServer.LogLevel != "" {
Expand Down

0 comments on commit a38c460

Please sign in to comment.