Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
elixxir
client
Commits
45bfa35f
Commit
45bfa35f
authored
3 years ago
by
Jono Wenger
Browse files
Options
Downloads
Patches
Plain Diff
Fix storage/utility/MessageBuffer.Add so that it loads messages from storage
parent
2d2abddd
Branches
Branches containing commit
Tags
Tags containing commit
3 merge requests
!510
Release
,
!207
WIP: Client Restructure
,
!203
Symmetric broadcast
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
storage/utility/messageBuffer.go
+12
-4
12 additions, 4 deletions
storage/utility/messageBuffer.go
with
12 additions
and
4 deletions
storage/utility/messageBuffer.go
+
12
−
4
View file @
45bfa35f
...
@@ -203,11 +203,19 @@ func (mb *MessageBuffer) Add(m interface{}) interface{} {
...
@@ -203,11 +203,19 @@ func (mb *MessageBuffer) Add(m interface{}) interface{} {
defer
mb
.
mux
.
Unlock
()
defer
mb
.
mux
.
Unlock
()
// Ensure message does not already exist in buffer
// Ensure message does not already exist in buffer
if
face1
,
exists1
:=
mb
.
messages
[
h
];
exists1
{
if
_
,
exists1
:=
mb
.
messages
[
h
];
exists1
{
return
face1
msg
,
err
:=
mb
.
handler
.
LoadMessage
(
mb
.
kv
,
MakeStoredMessageKey
(
mb
.
key
,
h
))
if
err
!=
nil
{
jww
.
FATAL
.
Panicf
(
"Error loading message %s: %v"
,
h
,
err
)
}
}
if
face2
,
exists2
:=
mb
.
processingMessages
[
h
];
exists2
{
return
msg
return
face2
}
if
_
,
exists2
:=
mb
.
processingMessages
[
h
];
exists2
{
msg
,
err
:=
mb
.
handler
.
LoadMessage
(
mb
.
kv
,
MakeStoredMessageKey
(
mb
.
key
,
h
))
if
err
!=
nil
{
jww
.
FATAL
.
Panicf
(
"Error loading processing message %s: %v"
,
h
,
err
)
}
return
msg
}
}
// Save message as versioned object
// Save message as versioned object
...
...
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