mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
chore: introduce dry run flag for data cleanup [skip ci]
This commit is contained in:
@@ -66,6 +66,10 @@ func (s *HousekeepingService) Schedule() {
|
||||
|
||||
func (s *HousekeepingService) CleanUserDataBefore(user *models.User, before time.Time) error {
|
||||
logbuch.Warn("cleaning up user data for '%s' older than %v", user.ID, before)
|
||||
if s.config.App.DataCleanupDryRun {
|
||||
logbuch.Info("skipping actual data deletion for '%v', because this is just a dry run", user.ID)
|
||||
return nil
|
||||
}
|
||||
|
||||
// clear old heartbeats
|
||||
if err := s.heartbeatSrvc.DeleteByUserBefore(user, before); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user