changed type for core section.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user