@@ -34,6 +34,7 @@ import (
3434 "github.com/west2-online/fzuhelper-server/pkg/constants"
3535 "github.com/west2-online/fzuhelper-server/pkg/db/model"
3636 "github.com/west2-online/fzuhelper-server/pkg/errno"
37+ "github.com/west2-online/fzuhelper-server/pkg/logger"
3738 "github.com/west2-online/fzuhelper-server/pkg/taskqueue"
3839 "github.com/west2-online/fzuhelper-server/pkg/umeng"
3940 "github.com/west2-online/fzuhelper-server/pkg/utils"
@@ -241,7 +242,8 @@ func (s *CourseService) putExamToDatabase(stuId string, term string, rawCourses
241242 for _ , change := range claimed {
242243 // 单个考试变化对应一个 dispatcher task,避免一批变化绕过 Umeng 限流。
243244 _ = umeng .EnqueueAsync (func () error {
244- return s .sendExamNotification (change )
245+ s .sendExamNotification (change )
246+ return nil
245247 })
246248 }
247249
@@ -258,15 +260,22 @@ func (s *CourseService) updateExamSnapshot(id int64, examInfo, examInfoSHA256 st
258260 return err
259261}
260262
261- func (s * CourseService ) sendExamNotification (change courseExamChange ) error {
263+ func (s * CourseService ) sendExamNotification (change courseExamChange ) {
262264 // 与成绩通知一致,推送失败仅由 Umeng 任务队列统一记录,不影响业务快照。
265+ // 这里直接不返回错误了,直接打印错误日志,因为就是安卓跟iOS都直推送一次,如果错过就直接算了
263266 title := fmt .Sprintf ("%v考试信息更新啦" , change .Exam .Name )
264267 description := fmt .Sprintf ("考试信息更新%v" , change .Tag [:12 ])
265- _ = umeng .SendAndroidGroupcastWithGoApp (
268+ if err : = umeng .SendAndroidGroupcastWithGoApp (
266269 title , "" , "" , change .Tag , description , constants .UmengExamRoomDeeplink ,
267- )
268- _ = umeng .SendIOSGroupcast (title , "" , "" , change .Tag , description , constants .UmengExamRoomDeeplink )
269- return nil
270+ ); err != nil {
271+ logger .Errorf ("CourseService.sendExamNotification: send Android notification failed: %v" , err )
272+ }
273+
274+ if err := umeng .SendIOSGroupcast (
275+ title , "" , "" , change .Tag , description , constants .UmengExamRoomDeeplink ,
276+ ); err != nil {
277+ logger .Errorf ("CourseService.sendExamNotification: send iOS notification failed: %v" , err )
278+ }
270279}
271280
272281func (s * CourseService ) GetCourseListYjsy (req * course.CourseListRequest , loginData * kitexModel.LoginData ) ([]* kitexModel.Course , error ) {
0 commit comments