parent
44bf37941b
commit
983aeeb33d
|
@ -52,7 +52,7 @@ type RequestPush struct {
|
|||
|
||||
// PushNotification is single notification request
|
||||
type PushNotification struct {
|
||||
ctx context.Context
|
||||
Ctx context.Context
|
||||
wg *sync.WaitGroup
|
||||
log *[]LogPushEntry
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ func SendNotification(req PushNotification) {
|
|||
}
|
||||
|
||||
select {
|
||||
case <-req.ctx.Done():
|
||||
case <-req.Ctx.Done():
|
||||
default:
|
||||
switch req.Platform {
|
||||
case PlatFormIos:
|
||||
|
@ -72,7 +72,7 @@ func queueNotification(ctx context.Context, req RequestPush) (int, []LogPushEntr
|
|||
|
||||
log := make([]LogPushEntry, 0, count)
|
||||
for _, notification := range newNotification {
|
||||
notification.ctx = ctx
|
||||
notification.Ctx = ctx
|
||||
if PushConf.Core.Sync {
|
||||
notification.wg = &wg
|
||||
notification.log = &log
|
||||
|
|
|
@ -50,6 +50,8 @@ func (s *Server) Check(ctx context.Context, in *proto.HealthCheckRequest) (*prot
|
|||
func (s *Server) Send(ctx context.Context, in *proto.NotificationRequest) (*proto.NotificationReply, error) {
|
||||
var badge = int(in.Badge)
|
||||
notification := gorush.PushNotification{
|
||||
Ctx: ctx,
|
||||
|
||||
Platform: int(in.Platform),
|
||||
Tokens: in.Tokens,
|
||||
Message: in.Message,
|
||||
|
|
Loading…
Reference in New Issue