Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #94 from mercari/feature/change_use_fcm_to_true
Browse files Browse the repository at this point in the history
change the default value of use_fcm to true
  • Loading branch information
cubicdaiya authored Oct 18, 2018
2 parents e06ea2c + aab92e4 commit b943460
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The configuration for Gaurun has some sections. The example is [here](conf/gauru
|keepalive_timeout|int |time for continuing keep-alive connection to GCM|90 | |
|keepalive_conns |int |number of keep-alive connection to GCM |runtime.NumCPU()||
|retry_max |int |maximum retry count for push notication to GCM |1 | |
|use_fcm |bool |Use FCM endpoint instead of GCM (by default, `gaurun` uses GCM endpoint) |false | |
|use_fcm |bool |Use FCM endpoint instead of GCM (by default, `gaurun` uses FCM endpoint) |true | |

## Log Section

Expand Down
10 changes: 5 additions & 5 deletions gaurun/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ func keepAliveInterval(keepAliveTimeout int) int {

// InitGCMClient initializes GCMClient which is globally declared.
func InitGCMClient() error {
// By default, use GCM endpoint. If UseFCM is explicitly enabled via configuration,
// use FCM endpoint.
url := gcm.GCMSendEndpoint
if ConfGaurun.Android.UseFCM {
url = gcm.FCMSendEndpoint
// By default, use FCM endpoint. If UseFCM is explicitly disabled via configuration,
// use GCM endpoint.
url := gcm.FCMSendEndpoint
if !ConfGaurun.Android.UseFCM {
url = gcm.GCMSendEndpoint
}

var err error
Expand Down
2 changes: 1 addition & 1 deletion gaurun/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func BuildDefaultConf() ConfToml {
conf.Android.KeepAliveTimeout = 90
conf.Android.KeepAliveConns = numCPU
conf.Android.RetryMax = 1
conf.Android.UseFCM = false
conf.Android.UseFCM = true
// iOS
conf.Ios.Enabled = true
conf.Ios.PemCertPath = ""
Expand Down
2 changes: 1 addition & 1 deletion gaurun/conf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (suite *ConfigTestSuite) TestValidateConfDefault() {
assert.Equal(suite.T(), suite.ConfGaurunDefault.Android.KeepAliveTimeout, 90)
assert.Equal(suite.T(), int64(suite.ConfGaurunDefault.Android.KeepAliveConns), suite.ConfGaurunDefault.Core.WorkerNum)
assert.Equal(suite.T(), suite.ConfGaurunDefault.Android.RetryMax, 1)
assert.Equal(suite.T(), suite.ConfGaurunDefault.Android.UseFCM, false)
assert.Equal(suite.T(), suite.ConfGaurunDefault.Android.UseFCM, true)
// Ios
assert.Equal(suite.T(), suite.ConfGaurunDefault.Ios.Enabled, true)
assert.Equal(suite.T(), suite.ConfGaurunDefault.Ios.PemCertPath, "")
Expand Down

0 comments on commit b943460

Please sign in to comment.