fix: various locks in the signaler
This commit is contained in:
@@ -83,7 +83,8 @@ func main() {
|
||||
// Wait for a session request
|
||||
session, err := client.PopSession(ctx, withAuth(token, &pb.PopSessionRequest{}))
|
||||
if err != nil {
|
||||
if s, ok := status.FromError(err); ok && s.Code() == codes.NotFound {
|
||||
code, hasCode := status.FromError(err)
|
||||
if hasCode && code.Code() == codes.NotFound {
|
||||
// try getting a new token
|
||||
token, err = getAuthToken(ctx, client, cfg)
|
||||
if err != nil {
|
||||
@@ -91,7 +92,10 @@ func main() {
|
||||
}
|
||||
continue
|
||||
}
|
||||
log.Error().Err(err).Msg("error creating session")
|
||||
log.Error().Err(err).Str("code", fmt.Sprintf("code %d", code.Code())).Bool("has code", hasCode).Msg("error creating session")
|
||||
continue
|
||||
}
|
||||
if session.Msg.GetId() == nil {
|
||||
continue
|
||||
}
|
||||
go handleSession(ctx, client, token, session, vid)
|
||||
|
||||
Reference in New Issue
Block a user