Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bobgroup-go-utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bob Public Utils
bobgroup-go-utils
Commits
503fc952
"Model/Carrier/Customshipping.php" did not exist on "a4d1f3925be671b2caacd4428aa7be33e27ea146"
Commit
503fc952
authored
3 years ago
by
Johan de Klerk
Browse files
Options
Downloads
Patches
Plain Diff
#24
: Fixed logic error
parent
056ff023
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
handler_utils/sqs.go
+8
-10
8 additions, 10 deletions
handler_utils/sqs.go
with
8 additions
and
10 deletions
handler_utils/sqs.go
+
8
−
10
View file @
503fc952
...
@@ -37,8 +37,7 @@ func GetRecord(s3Session *s3.SessionWithHelpers, bucket string, message events.S
...
@@ -37,8 +37,7 @@ func GetRecord(s3Session *s3.SessionWithHelpers, bucket string, message events.S
recordValuePtr
:=
reflect
.
New
(
recordType
)
recordValuePtr
:=
reflect
.
New
(
recordType
)
// Check if message body should be retrieved from S3
// Check if message body should be retrieved from S3
if
messageAttribute
,
ok
:=
message
.
MessageAttributes
[
sqs
.
SQSMessageOnS3Key
];
ok
{
if
messageAttribute
,
ok
:=
message
.
MessageAttributes
[
sqs
.
SQSMessageOnS3Key
];
ok
&&
messageAttribute
.
StringValue
!=
nil
&&
*
messageAttribute
.
StringValue
==
"true"
{
if
messageAttribute
.
StringValue
!=
nil
&&
*
messageAttribute
.
StringValue
==
"true"
{
messageBytes
,
err
:=
sqs
.
RetrieveMessageFromS3
(
s3Session
,
bucket
,
message
.
Body
)
messageBytes
,
err
:=
sqs
.
RetrieveMessageFromS3
(
s3Session
,
bucket
,
message
.
Body
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
errors
.
Wrapf
(
err
,
"failed to get sqs message body from s3"
)
return
nil
,
errors
.
Wrapf
(
err
,
"failed to get sqs message body from s3"
)
...
@@ -48,7 +47,6 @@ func GetRecord(s3Session *s3.SessionWithHelpers, bucket string, message events.S
...
@@ -48,7 +47,6 @@ func GetRecord(s3Session *s3.SessionWithHelpers, bucket string, message events.S
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
errors
.
Wrapf
(
err
,
"failed to JSON decode message body"
)
return
nil
,
errors
.
Wrapf
(
err
,
"failed to JSON decode message body"
)
}
}
}
}
else
{
}
else
{
// Message was small enough, it is contained in the message body
// Message was small enough, it is contained in the message body
err
:=
json
.
Unmarshal
([]
byte
(
message
.
Body
),
recordValuePtr
.
Interface
())
err
:=
json
.
Unmarshal
([]
byte
(
message
.
Body
),
recordValuePtr
.
Interface
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment