Page MenuHomePhorge

Metric to detect users that need a cleanup
ClosedPublic

Authored by mollekopf on Nov 18 2024, 12:27 PM.

Details

Reviewers
machniak
Group Reviewers
Restricted Project
Commits
rK9f3eb54ceae8: Metric to detect users that need a cleanup
Summary

via artisan user:reync --deleted-only

Diff Detail

Repository
rK kolab
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mollekopf created this revision.
mollekopf added a reviewer: Restricted Project.Nov 18 2024, 12:27 PM
machniak subscribed.

Maybe where deleted_at < "5 seconds ago" would be better to give some slack to users deleted "right now".

This revision is now accepted and ready to land.Nov 18 2024, 12:31 PM

Also, whereNot('status', '&', User::STATUS_DELETED) would probably do the same. This status is set after user deletion from LDAP/IMAP was successful.

Also, whereNot('status', '&', User::STATUS_DELETED) would probably do the same. This status is set after user deletion from LDAP/IMAP was successful.

aren't we then risking not including users that should be deleted, but where the job failed to mark the user as fully deleted? (which also needs manual cleanup I suppose?)

Take a look at App\Jobs\User\DeleteJob, it will add STATUS_DELETED after all code before passes (does not throw an exception). So, checking for missing STATUS_DELETED should be included, and probably should be enough to check just this one.

Makes sense in principle, but yields about 20k fewer entries it seems (even when filtering only for the "pushed" jobs).