| | |
| | | task.mutex.Lock() |
| | | defer task.mutex.Unlock() |
| | | |
| | | logger.Debug("Add Face Notification %s. faceId: %s", task.conf.Ext.Title, face.FaceID) |
| | | task.faceList = append(task.faceList, face) |
| | | } |
| | | |
| | |
| | | task.mutex.Lock() |
| | | defer task.mutex.Unlock() |
| | | |
| | | logger.Debug("Add Person Notification %s. personId: %s", task.conf.Ext.Title, person.PersonID) |
| | | task.personList = append(task.personList, person) |
| | | } |
| | | |
| | |
| | | case vo.SubscribeFace: |
| | | msg = task.packFaceNotificationMsg() |
| | | case vo.SubscribePerson: |
| | | msg = task.packPersonNotificationMsg() |
| | | } |
| | | |
| | | if msg != nil { |
| | |
| | | |
| | | func (task *NotificationTask) packPersonNotificationMsg() *vo.RequestSubscribeNotification { |
| | | triggerTime := time.Now().Format("20060102150405") |
| | | if len(task.faceList) == 0 { |
| | | if len(task.personList) == 0 { |
| | | return nil |
| | | } |
| | | |