1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: respect errors thrown in misc functions

This commit is contained in:
Ferdinand Mütsch 2023-05-15 21:25:03 +02:00
parent 74390bfccf
commit 1a6ee55d14

View File

@ -268,16 +268,25 @@ func (srv *MiscService) sendSubscriptionNotificationScheduled(user *models.User,
}
func (srv *MiscService) existsUsersTotalTime() bool {
results, _ := srv.keyValueService.GetByPrefix(config.KeyLatestTotalTime)
results, err := srv.keyValueService.GetByPrefix(config.KeyLatestTotalTime)
if err != nil {
config.Log().Error("failed to fetch latest time key-values, %v", err)
}
return len(results) > 0
}
func (srv *MiscService) existsUsersFirstData() bool {
results, _ := srv.keyValueService.GetByPrefix(config.KeyFirstHeartbeat)
results, err := srv.keyValueService.GetByPrefix(config.KeyFirstHeartbeat)
if err != nil {
config.Log().Error("failed to fetch first heartbeats key-values, %v", err)
}
return len(results) > 0
}
func (srv *MiscService) existsSubscriptionNotifications() bool {
results, _ := srv.keyValueService.GetByPrefix(config.KeySubscriptionNotificationSent)
results, err := srv.keyValueService.GetByPrefix(config.KeySubscriptionNotificationSent)
if err != nil {
config.Log().Error("failed to fetch notifications key-values, %v", err)
}
return len(results) > 0
}