Browse Source

修改推送、修改剑鱼

renzheng 9 years ago
parent
commit
428e38531d

+ 11 - 0
common/src/qfw/util/mongodb/mongodbutil_test.go

@@ -172,3 +172,14 @@ func Test_range(t *testing.T){
 		}
 }
 
+
+func Test_Credit(t *testing.T) {
+	//InitMongodbPool(1, "10.116.86.154:27080", "qfw")
+	//u:=FindById("user","55a30cdfaf53744fca000b51",nil)
+	//cre:=util.IntAll((*u)["credit_a"])
+	//cre2:=util.Int64All((*u)["credit_a"])
+	 s :=int64(1152921504606848907)
+	log.Println(s,int(s))
+
+}
+

+ 5 - 1
core/src/qfw/mobile/wxmenu.go

@@ -317,9 +317,11 @@ func (m *Mobile) AjaxReq() error {
 			}
 			//更新数据库
 			msgset["l_modifydate"] = time.Now().Unix()
+			
 			if mongodb.Update("user", `{"_id":"`+userId.(string)+`"}`, &map[string]interface{}{"$set": set}, false, false) {
 				flag = "y"
-				credit_a := util.IntAll(m.GetSession("credit_a"))
+			/**
+				credit_a := util.Int64All(m.GetSession("credit_a"))
 				if !credit.AIsHasDo(credit.A_JYSCTS, credit_a) && len(mapPush) > 0 {
 					util.Try(func() {
 						//对用户进行推送
@@ -339,7 +341,9 @@ func (m *Mobile) AjaxReq() error {
 						log.Println("给用户推送出错", e)
 					})
 				}
+				**/
 			}
+			
 		}
 		break
 	}

+ 2 - 1
push/src/main.go

@@ -42,7 +42,8 @@ var jobs []push.PushJobFace = []push.PushJobFace{
 var bJobs = true
 
 func runJob() {
-	if bJobs {
+	h:=time.Now().Hour()
+	if bJobs && h>5 &&h <23 {
 		bJobs = false
 		for _, job := range jobs {
 			//单个job内部实现多并发,job间不再支持并发,网络压力太大了

+ 3 - 2
push/src/qfw/push/rpcpush/rpcpush.go

@@ -2,13 +2,11 @@ package rpcpush
 
 import (
 	"encoding/json"
-	"fmt"
 	"log"
 	"qfw/push/bid"
 	"qfw/push/dopush"
 	"qfw/util"
 	qrpc "qfw/util/rpc"
-	"time"
 )
 
 type PushInfo struct {
@@ -41,6 +39,8 @@ func (p *PushInfo) ResultView(data *qrpc.PushData, Reply *[]byte) error {
 //RPC调用推送信息
 func (p *PushInfo) PushMsg(data *qrpc.PushData, Reply *int) error {
 	util.Try(func() {
+		*Reply = 1
+		/**
 		for k, v := range data.PushType {
 			//昨天到今天的数据
 			pj := dopush.Pjob{
@@ -57,6 +57,7 @@ func (p *PushInfo) PushMsg(data *qrpc.PushData, Reply *int) error {
 				*Reply = 0
 			}
 		}
+		**/
 	}, func(e interface{}) {})
 	return nil
 }