v.0.0.3.2 Добавлена поверка userId == 0 в StreamMessages
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
77442e93f3
commit
cd8b954a70
@ -8,6 +8,8 @@ import (
|
||||
"github.com/jackc/pgx/v4/pgxpool"
|
||||
amqp "github.com/rabbitmq/amqp091-go"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
protobuf "google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
"log"
|
||||
@ -340,6 +342,11 @@ func (s *server) UpdateMessageStatus(ctx context.Context, req *proto.UpdateMessa
|
||||
}
|
||||
|
||||
func (s *server) StreamMessages(req *proto.StreamMessagesRequest, stream proto.MessageService_StreamMessagesServer) error {
|
||||
|
||||
if req.UserId == 0 {
|
||||
return status.Error(codes.InvalidArgument, "userID cannot be 0")
|
||||
}
|
||||
|
||||
const maxRetries = 5
|
||||
retryDelay := time.Second
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user