Jianghan hai 11 meses
pai
achega
128e96a3ad

+ 5 - 1
telemarketingEtl/entity/Voiced.go

@@ -28,7 +28,7 @@ var (
 	firstLoad, firstLoad1 = true, true
 	mUser                 = make(map[string]*Called) // 用户
 	userPhone             = make(map[string]string)  // 手机号-用户uid
-	userPhoneMx           sync.Mutex
+	userPhoneMx           sync.RWMutex
 	callPhone             []string                   // 所有被叫手机号
 	missedPhone           = make(map[string]*Voiced) // 所有被叫未接通手机号
 )
@@ -51,7 +51,9 @@ func CountCalled() {
 	log.Println("CountCalled 通话记录加载结束...")
 
 	for _, s := range callPhone {
+		userPhoneMx.RLock()
 		uid := userPhone[s]
+		userPhoneMx.RUnlock()
 		if uid != "" {
 			mUser[uid].frequency += 1
 		}
@@ -247,7 +249,9 @@ func getMissedCalls() {
 		phone := common.ObjToString(ret["CalledNo"])
 		vdate := strings.Split(common.ObjToString(ret["createTime"]), " ")[0]
 		ctype := common.ObjToString(ret["State"])
+		userPhoneMx.RLock()
 		uid := userPhone[phone]
+		userPhoneMx.RUnlock()
 		if uid != "" {
 			if ctype != "dealing" {
 				if missedPhone[uid] != nil {

+ 2 - 2
telemarketingEtl/entity/dwd_f_userbase_visit_info.go

@@ -418,7 +418,7 @@ func Count3DaysDetail() {
 		}
 		err = rows.Scan(scanArgs...)
 		if err != nil {
-			log.Println("CountMaxVisit---", err)
+			log.Println("Count3DaysDetail---", err)
 			break
 		}
 		for i, col := range values {
@@ -429,7 +429,7 @@ func Count3DaysDetail() {
 			}
 		}
 		count++
-		if count%2000 == 0 {
+		if count%5000 == 0 {
 			log.Println("Count3DaysDetail current-------", count)
 		}
 		uid := common.ObjToString(ret["uid"])

+ 3 - 0
telemarketingEtl/main.go

@@ -15,6 +15,9 @@ func main() {
 	//t3.Run()
 	//t4 := &timetask.TaskVipExpire{}
 	//t4.Run()
+	t5 := &timetask.TaskJyDetail{}
+	t5.Run()
+
 	//t := &timetask.TaskVisitInfo{}
 	//t.Run()