Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support to remove data from deleted users, fixes #32 #110

Merged
merged 2 commits into from
Feb 7, 2019

Conversation

stalker314314
Copy link
Collaborator

If user is deleted from Nextcloud, all files from that users are also deleted. However, we don't have callback for that, and we end up with bunch of images/faces/persons in database which do not exist anymore, either in filecache or physically, on disk. Since those stuff can pile up, best is to clean them from time to time, and we use another task for that.

Tests also added.

Copy link
Owner

@matiasdelellis matiasdelellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stalker314314
Copy link
Collaborator Author

stalker314314 commented Jan 28, 2019

You have to use hooks for it..

Not sure I understand, can you clarify? I already explained why hooks are not an option in associated issue #32. Do you mean that or some other hooks?

@matiasdelellis
Copy link
Owner

You have to use hooks for it..

Not sure I understand, can you clarify? I already explained why hooks are not an option in associated issue #32. Do you mean that or sođe other hooks?

Ohh.. Now remember it.. 😞
During the day I check it... but I think we should report it to NC.. ;)

@stalker314314
Copy link
Collaborator Author

Filed issue nextcloud/server#14004, but I would not hold my breath on this:)

Friendly ping for you to take a look:)

@stalker314314
Copy link
Collaborator Author

OK, completely changed this pull request! Removed everything and replaced with hook. No tests, though (test for reset already exist). BTW, you can easily try it out with simple ./occ user:add and ./occ user:delete commands.

P.S. I was lucky to extract reset functionality into separate commit (c4d1b2f), so stuff here were easy to refactor.

lib/Watcher.php Outdated Show resolved Hide resolved
Copy link
Owner

@matiasdelellis matiasdelellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful.. 😅

@matiasdelellis
Copy link
Owner

Just to be sure, when you were talking about business logic, you referring to using a single command that executes all the tasks?

@stalker314314
Copy link
Collaborator Author

Just to be sure, when you were talking about business logic, you referring to using a single command that executes all the tasks?

Yeah, in the sense "all of background processing". I think of it as all classes under Tasks. But, ignore my comments about "grouping business logic together", business logic is in Watcher.php too...

@stalker314314 stalker314314 merged commit 3789968 into master Feb 7, 2019
@stalker314314 stalker314314 deleted the cleanup-after-deleted-users branch February 7, 2019 21:38
stalker314314 added a commit that referenced this pull request Feb 17, 2019
* Adding support to remove data from deleted users
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants