From 264b4d5bfd7aeb7cc8198ce18e4f9c51bf2f963e Mon Sep 17 00:00:00 2001 From: Harrison Sunda Date: Wed, 14 Aug 2024 06:42:27 +0300 Subject: [PATCH] fix: initialize FCM client once. --- notify/notification_fcm.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/notify/notification_fcm.go b/notify/notification_fcm.go index 58dff0839..bfc8547fa 100644 --- a/notify/notification_fcm.go +++ b/notify/notification_fcm.go @@ -46,10 +46,13 @@ func InitFCMClient(ctx context.Context, cfg *config.ConfYaml) (*fcm.Client, erro return FCMClient, nil } - return fcm.NewClient( + var err error + FCMClient, err = fcm.NewClient( ctx, opts..., ) + + return FCMClient, err } // GetAndroidNotification use for define Android notification.