Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
notifications-bot
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
archives
notifications-bot
Commits
455c6afd
Commit
455c6afd
authored
Oct 12, 2021
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
Add a sync map for rounds received
parent
9427868d
No related branches found
No related tags found
2 merge requests
!12
Release
,
!9
Add a sync map for rounds received
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
notifications/notifications.go
+9
-0
9 additions, 0 deletions
notifications/notifications.go
with
9 additions
and
0 deletions
notifications/notifications.go
+
9
−
0
View file @
455c6afd
...
@@ -11,6 +11,7 @@ package notifications
...
@@ -11,6 +11,7 @@ package notifications
import
(
import
(
"encoding/base64"
"encoding/base64"
"gitlab.com/elixxir/notifications-bot/notifications/apns"
"gitlab.com/elixxir/notifications-bot/notifications/apns"
"sync"
// "github.com/jonahh-yeti/apns"
// "github.com/jonahh-yeti/apns"
"github.com/pkg/errors"
"github.com/pkg/errors"
...
@@ -65,6 +66,7 @@ type Impl struct {
...
@@ -65,6 +66,7 @@ type Impl struct {
fcm
*
firebase
.
FirebaseComm
fcm
*
firebase
.
FirebaseComm
apnsClient
*
apns
.
ApnsComm
apnsClient
*
apns
.
ApnsComm
receivedNdf
*
uint32
receivedNdf
*
uint32
roundStore
sync
.
Map
ndfStopper
Stopper
ndfStopper
Stopper
}
}
...
@@ -333,6 +335,13 @@ func (nb *Impl) ReceiveNotificationBatch(notifBatch *pb.NotificationBatch, auth
...
@@ -333,6 +335,13 @@ func (nb *Impl) ReceiveNotificationBatch(notifBatch *pb.NotificationBatch, auth
// return errors.New("Cannot receive notification data: client is not authenticated")
// return errors.New("Cannot receive notification data: client is not authenticated")
//}
//}
rid
:=
notifBatch
.
RoundID
_
,
loaded
:=
nb
.
roundStore
.
LoadOrStore
(
rid
,
true
)
if
loaded
{
return
nil
}
jww
.
INFO
.
Printf
(
"Received notification batch for round %+v"
,
notifBatch
.
RoundID
)
jww
.
INFO
.
Printf
(
"Received notification batch for round %+v"
,
notifBatch
.
RoundID
)
for
_
,
notifData
:=
range
notifBatch
.
GetNotifications
()
{
for
_
,
notifData
:=
range
notifBatch
.
GetNotifications
()
{
...
...
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