Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
just add debugging
Browse files Browse the repository at this point in the history
Signed-off-by: Yee Hing Tong <[email protected]>
  • Loading branch information
wild-endeavor committed Sep 20, 2023
1 parent dc8cc9d commit 5791949
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/async/notifications/implementations/aws_emailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func FlyteEmailToSesEmailInput(email admin.EmailMessage) ses.SendEmailInput {
}

func (e *AwsEmailer) SendEmail(ctx context.Context, email admin.EmailMessage) error {
logger.Infof(ctx, "debugb64 Sending email %v", email.Body)
emailInput := FlyteEmailToSesEmailInput(email)
_, err := e.awsEmail.SendEmail(&emailInput)
e.systemMetrics.SendTotal.Inc()
Expand Down
5 changes: 5 additions & 0 deletions pkg/async/notifications/implementations/aws_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ func (p *Processor) run() error {
var emailMessage admin.EmailMessage
var err error
for msg := range p.sub.Start() {
ctx := context.Background()

p.systemMetrics.MessageTotal.Inc()
// Currently this is safe because Gizmo takes a string and casts it to a byte array.
stringMsg := string(msg.Message())
logger.Infof(ctx, "debugb64 Original stringMsg [%v]", stringMsg)

var snsJSONFormat map[string]interface{}

Expand All @@ -53,6 +56,7 @@ func (p *Processor) run() error {
p.markMessageDone(msg)
continue
}
logger.Infof(ctx, "debugb64 snsJSONFormat [%v]", snsJSONFormat)

var value interface{}
var ok bool
Expand Down Expand Up @@ -81,6 +85,7 @@ func (p *Processor) run() error {
p.markMessageDone(msg)
continue
}
logger.Infof(ctx, "debugb64 Decoded valueString [%v] to [%v]", valueString, notificationBytes)

if err = proto.Unmarshal(notificationBytes, &emailMessage); err != nil {
logger.Debugf(context.Background(), "failed to unmarshal to notification object from decoded string[%s] from message [%s] with err: %v", valueString, stringMsg, err)
Expand Down

0 comments on commit 5791949

Please sign in to comment.