mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-20 14:35:07 +00:00
add debugging to events handler
This commit is contained in:
@@ -103,7 +103,6 @@ func (s *Event) Read(ctx context.Context, req *pb.ReadRequest, rsp *pb.ReadRespo
|
|||||||
// create tenant based topics
|
// create tenant based topics
|
||||||
topic := path.Join("event", id, req.Topic)
|
topic := path.Join("event", id, req.Topic)
|
||||||
|
|
||||||
log.Infof("Tenant %v reading %v\n", id, req.Topic)
|
|
||||||
limit := uint(25)
|
limit := uint(25)
|
||||||
offset := uint(0)
|
offset := uint(0)
|
||||||
|
|
||||||
@@ -115,11 +114,15 @@ func (s *Event) Read(ctx context.Context, req *pb.ReadRequest, rsp *pb.ReadRespo
|
|||||||
offset = uint(req.Offset)
|
offset = uint(req.Offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Infof("Tenant %v reading %v limit: %v offset: %v\n", id, req.Topic, req.Limit, req.Offset)
|
||||||
|
|
||||||
events, err := events.Read(topic, events.ReadLimit(limit), events.ReadOffset(offset))
|
events, err := events.Read(topic, events.ReadLimit(limit), events.ReadOffset(offset))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Infof("Events read %v", len(events))
|
||||||
|
|
||||||
for _, ev := range events {
|
for _, ev := range events {
|
||||||
// unmarshal the message into a struct
|
// unmarshal the message into a struct
|
||||||
d := &structpb.Struct{}
|
d := &structpb.Struct{}
|
||||||
|
|||||||
Reference in New Issue
Block a user