changed type for core section.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2016-09-02 15:55:47 +08:00
parent fe7460ef09
commit 3294dbaf95
7 changed files with 18 additions and 18 deletions

View File

@@ -186,10 +186,10 @@ func InitAPNSClient() error {
}
// InitWorkers for initialize all workers.
func InitWorkers(workerNum, queueNum int) {
func InitWorkers(workerNum int64, queueNum int64) {
LogAccess.Debug("worker number is ", workerNum, ", queue number is ", queueNum)
QueueNotification = make(chan PushNotification, queueNum)
for i := 0; i < workerNum; i++ {
for i := int64(0); i < workerNum; i++ {
go startWorker()
}
}

View File

@@ -329,7 +329,7 @@ func TestOverwriteAndroidAPIKey(t *testing.T) {
func TestSenMultipleNotifications(t *testing.T) {
PushConf = config.BuildDefaultPushConf()
InitWorkers(2, 2)
InitWorkers(int64(2), 2)
PushConf.Ios.Enabled = true
PushConf.Ios.KeyPath = "../certificate/certificate-valid.pem"

View File

@@ -40,7 +40,7 @@ func pushHandler(c *gin.Context) {
return
}
if len(form.Notifications) > PushConf.Core.MaxNotification {
if int64(len(form.Notifications)) > PushConf.Core.MaxNotification {
msg = fmt.Sprintf("Number of notifications(%d) over limit(%d)", len(form.Notifications), PushConf.Core.MaxNotification)
LogAccess.Debug(msg)
abortWithError(c, http.StatusBadRequest, msg)

View File

@@ -151,7 +151,7 @@ func TestEmptyNotifications(t *testing.T) {
func TestOutOfRangeMaxNotifications(t *testing.T) {
initTest()
PushConf.Core.MaxNotification = 1
PushConf.Core.MaxNotification = int64(1)
r := gofight.New()