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

fix: dont clean data for subscribed users

This commit is contained in:
Ferdinand Mütsch 2022-12-23 14:08:13 +01:00
parent 195755581b
commit 8ca1404f8b

View File

@ -48,6 +48,11 @@ func (s *HousekeepingService) Schedule() {
// schedule jobs // schedule jobs
for _, u := range users { for _, u := range users {
// don't clean data for subscribed users
if s.config.Subscriptions.Enabled && u.HasActiveSubscription() {
continue
}
user := *u user := *u
s.queueWorkers.Dispatch(func() { s.queueWorkers.Dispatch(func() {
if err := s.ClearOldUserData(&user, retentionDuration); err != nil { if err := s.ClearOldUserData(&user, retentionDuration); err != nil {