feat: replace http polling with webscoket notify in sd image page

This commit is contained in:
RockYang
2024-02-26 15:45:54 +08:00
parent 668d4c9c64
commit b95dff0751
8 changed files with 189 additions and 124 deletions

View File

@@ -310,4 +310,7 @@ func (s *Service) callback(data CBReq) {
// restore img_calls
s.db.Model(&model.User{}).Where("id = ? AND img_calls > 0", data.UserId).UpdateColumn("img_calls", gorm.Expr("img_calls + ?", 1))
}
// 发送更新状态信号
s.notifyQueue.RPush(data.UserId)
}