chore: fix Enabled config for iOS, Android and Huawei (#577)
Co-authored-by: Viktor Radchenko <1641795+vikmeup@users.noreply.github.com>
This commit is contained in:
parent
fbedf3c82b
commit
da4ca22d70
18
main.go
18
main.go
|
@ -323,16 +323,22 @@ func main() {
|
|||
|
||||
gorush.InitWorkers(ctx, wg, gorush.PushConf.Core.WorkerNum, gorush.PushConf.Core.QueueNum)
|
||||
|
||||
if err = gorush.InitAPNSClient(); err != nil {
|
||||
gorush.LogError.Fatal(err)
|
||||
if gorush.PushConf.Ios.Enabled {
|
||||
if err = gorush.InitAPNSClient(); err != nil {
|
||||
gorush.LogError.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
if _, err = gorush.InitFCMClient(gorush.PushConf.Android.APIKey); err != nil {
|
||||
gorush.LogError.Fatal(err)
|
||||
if gorush.PushConf.Android.Enabled {
|
||||
if _, err = gorush.InitFCMClient(gorush.PushConf.Android.APIKey); err != nil {
|
||||
gorush.LogError.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
if _, err = gorush.InitHMSClient(gorush.PushConf.Huawei.AppSecret, gorush.PushConf.Huawei.AppID); err != nil {
|
||||
gorush.LogError.Fatal(err)
|
||||
if gorush.PushConf.Huawei.Enabled {
|
||||
if _, err = gorush.InitHMSClient(gorush.PushConf.Huawei.AppSecret, gorush.PushConf.Huawei.AppID); err != nil {
|
||||
gorush.LogError.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
var g errgroup.Group
|
||||
|
|
Loading…
Reference in New Issue