Page MenuHomePhorge

user:purge command to delete inactive users
Changes PlannedPublic

Authored by mollekopf on Fri, Nov 22, 7:30 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 10, 7:29 AM
Unknown Object (File)
Sat, Dec 7, 10:19 PM
Unknown Object (File)
Sat, Dec 7, 8:23 PM
Unknown Object (File)
Sat, Nov 30, 3:23 AM
Unknown Object (File)
Fri, Nov 29, 8:32 PM
Unknown Object (File)
Fri, Nov 29, 7:24 PM
Unknown Object (File)
Fri, Nov 29, 2:24 PM
Unknown Object (File)
Fri, Nov 29, 6:55 AM
Subscribers

Details

Reviewers
machniak
Group Reviewers
Restricted Project

Diff Detail

Repository
rK kolab
Branch
dev/mollekopf
Lint
Lint Skipped
Unit
No Test Coverage
Build Status
Buildable 52210
Build 18534: arc lint + arc unit

Event Timeline

mollekopf created this revision.
mollekopf added a reviewer: Restricted Project.Fri, Nov 22, 7:32 AM

Questions:

  • Is this good enough to detect inactivity?
  • Is the degraded state good enough or do we need to check the wallet balance?

The query seems to currently be super slow, while the commented query executes reasonably fast in sql.

Fixed some typos, now the query exeutes in reasonable time

Check updated_at/created_at

machniak subscribed.
machniak added inline comments.
src/app/Console/Commands/User/PurgeCommand.php
39

There's a potential for user error, if you write --min-age=2 but you intended 2y. I'd make 'd' obligatory for days or even remove that possibility.

58

See App\Console\Command::handle() for how to ask a user for confirmation. I'd prefer that than just an option.

90
104

I would add orderBy('created_at'). To start deleting from the oldest.

112

This works only because of a bug in DeleteJob. It should not allow to be executed on a non-deleted user. We should do something different.

This revision now requires changes to proceed.Fri, Nov 22, 8:28 AM

just as an fyi, purging users became less of a priority, so I'm parking this diff for now.