|
@@ -61,8 +61,6 @@ func (this *SubscribeOpenService) updateSubscribe(deviceId string, openId string
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func (this *SubscribeOpenService) Open() error {
|
|
func (this *SubscribeOpenService) Open() error {
|
|
|
- logger.Info("user sign subscribe device_id: %s open_id: %s, module: %s", this.DeviceId, this.OpenId, this.Module)
|
|
|
|
|
-
|
|
|
|
|
subscribeOne := new(subscribe.Subscribe)
|
|
subscribeOne := new(subscribe.Subscribe)
|
|
|
err := mgm.Coll(&subscribe.Subscribe{}).First(bson.M{"device_id": this.DeviceId}, subscribeOne)
|
|
err := mgm.Coll(&subscribe.Subscribe{}).First(bson.M{"device_id": this.DeviceId}, subscribeOne)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -143,7 +141,7 @@ func (this *SubscribeSendService) Send() error {
|
|
|
for _, v := range list {
|
|
for _, v := range list {
|
|
|
openIds = append(openIds, v.OpenId)
|
|
openIds = append(openIds, v.OpenId)
|
|
|
}
|
|
}
|
|
|
- logger.Info("send openIds to SubscribeTask %v", openIds)
|
|
|
|
|
|
|
+
|
|
|
task.SubscribeTask.Send(openIds, this.Module)
|
|
task.SubscribeTask.Send(openIds, this.Module)
|
|
|
return err
|
|
return err
|
|
|
}
|
|
}
|
|
@@ -169,6 +167,7 @@ func (this *SubscribeTaskService) Task() error {
|
|
|
|
|
|
|
|
this.Timestamp = util.GetNowSecond() + 5*1000
|
|
this.Timestamp = util.GetNowSecond() + 5*1000
|
|
|
if this.Status {
|
|
if this.Status {
|
|
|
|
|
+ logger.Info("Subscribe task append key %s, device id %s duration %d", key, this.DeviceId, this.Timestamp/1000)
|
|
|
task.SubscribeTask.Append(key, this.DeviceId, this.Timestamp, this.Module)
|
|
task.SubscribeTask.Append(key, this.DeviceId, this.Timestamp, this.Module)
|
|
|
} else {
|
|
} else {
|
|
|
task.SubscribeTask.Remove(key)
|
|
task.SubscribeTask.Remove(key)
|