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:
kerem 2021-06-21 19:17:57 +03:00 committed by GitHub
parent fbedf3c82b
commit da4ca22d70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 6 deletions

18
main.go
View File

@ -323,16 +323,22 @@ func main() {
gorush.InitWorkers(ctx, wg, gorush.PushConf.Core.WorkerNum, gorush.PushConf.Core.QueueNum) gorush.InitWorkers(ctx, wg, gorush.PushConf.Core.WorkerNum, gorush.PushConf.Core.QueueNum)
if err = gorush.InitAPNSClient(); err != nil { if gorush.PushConf.Ios.Enabled {
gorush.LogError.Fatal(err) if err = gorush.InitAPNSClient(); err != nil {
gorush.LogError.Fatal(err)
}
} }
if _, err = gorush.InitFCMClient(gorush.PushConf.Android.APIKey); err != nil { if gorush.PushConf.Android.Enabled {
gorush.LogError.Fatal(err) 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 { if gorush.PushConf.Huawei.Enabled {
gorush.LogError.Fatal(err) if _, err = gorush.InitHMSClient(gorush.PushConf.Huawei.AppSecret, gorush.PushConf.Huawei.AppID); err != nil {
gorush.LogError.Fatal(err)
}
} }
var g errgroup.Group var g errgroup.Group