From b5166ec34cea995536384391712373f1d0d69e28 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期二, 28 五月 2024 17:53:25 +0800
Subject: [PATCH] 修改新 face id 格式
---
service/subscribe.go | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/service/subscribe.go b/service/subscribe.go
index ccc9b5c..70853cf 100644
--- a/service/subscribe.go
+++ b/service/subscribe.go
@@ -78,7 +78,7 @@
return true
})
- logger.Debug("Add Face Notification.")
+ logger.Debug("Add Face Notification.faceId: %s, faceFeath: %s", face.IDNumber, face.OtherFeature)
}
func StopSubscribeTask() {
@@ -109,11 +109,11 @@
}
type SubscribeTask struct {
- ctx context.Context
- conf *models.Subscribe
- faceList []*vo.FaceObject
- mutex sync.Mutex
- lastExecTime int64
+ ctx context.Context
+ conf *models.Subscribe
+ faceList []*vo.FaceObject
+ mutex sync.Mutex
+ lastApeExecTime int64
}
func (task *SubscribeTask) Start() {
@@ -150,7 +150,9 @@
triggerTime := time.Now().Format("20060102150405")
// 涓婃姤璁惧 鎺у埗璁惧閫氱煡鎺у埗棰戠巼, 閬垮厤棰戠箒, 涓婄骇涓�鑸細涓嬪彂绉掔骇鐨勪换鍔�, 浣嗚澶囦笉浼氶绻佹洿鏂�,
- if subType == vo.SubscribeApe && time.Now().Unix()-task.lastExecTime > 60*10 {
+ if subType == vo.SubscribeApe && time.Now().Unix()-task.lastApeExecTime > 60*10 {
+ task.lastApeExecTime = time.Now().Unix()
+
var notification = vo.DeviceNotification{
NotificationID: triggerTime + snowflake.GenerateIdStr(),
SubscribeID: task.conf.Id,
@@ -219,6 +221,4 @@
client.Notify(task.conf.Ext.ReceiveAddr, b)
}
}
-
- task.lastExecTime = time.Now().Unix()
}
--
Gitblit v1.8.0