Skip to content

Expire files from the trash in the background - #14644

Merged
DeepDiver1975 merged 4 commits into
masterfrom
trash-expire-command
Mar 16, 2015
Merged

DeepDiver1975 merged 4 commits into
masterfrom
trash-expire-command

Conversation

@icewind1991

Copy link
Copy Markdown
Contributor

Move expiring the trash to the async command bus and add some generic logic to allow unit tests to work with the command bus.

Note that this is only a minimal set of changes to make it async, the trash app could use some further cleanup.

cc @DeepDiver1975 @PVince81 @schiesbn

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hmm - what for we require that class?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Might also be worth it to use this when in CLI mode/cron instead of the async bus to run commands triggered from commands immediately

Comment thread tests/lib/testcase.php

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@DeepDiver1975 seems to be needed for the unit test.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In case this is a pure test helper class - it should live in the tests namespace

@PVince81

PVince81 commented Mar 3, 2015

Copy link
Copy Markdown
Contributor

What if expire is called multiple times due for example to the sync client uploading 3 files at the same time ?
From what I understand it would add the job three times and run it three times. (no debounce).

I feel like there are several scenarios where we might want to have some kind of debounce that either only runs the first scheduled instance or the last one (defer to later).

What do you think ?

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Worst case: 2 out of 3 jobs will find nothing to do and terminate quickly - this is what happens today as well - the expiry code is triggered on every request and wastes cpu.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

And yes - some kind of debounce logic might be interesting - but I prefer to add this in a later stage. Let's get this system stable first and see what we can get out of it.

Comment thread apps/files_trashbin/command/expire.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In case multiple commands are executed for different users the filesystem will only be mounted for the first user.
Looks like we need some kind of tear down as well ....

@icewind1991

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like we need some kind of tear down as well ....

#14775

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is already a tearDownFS() method. One should just not forget about calling it...

I hope one day we can get rid of those static setupFS mess...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

        \OC_Util::tearDownFS();

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@icewind1991 please have a look - THX

@scrutinizer-notifier

Copy link
Copy Markdown

The inspection completed: 3993 Issues, 120 Patches

@ghost

ghost commented Mar 10, 2015

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/10312/
Test PASSed.

@icewind1991

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 changes look good

@DeepDiver1975

Copy link
Copy Markdown
Contributor

👍 for @icewind1991's changes

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@DeepDiver1975 changes look good

counting as 👍

DeepDiver1975 added a commit that referenced this pull request Mar 16, 2015
Expire files from the trash in the background
@DeepDiver1975
DeepDiver1975 merged commit bbaf97c into master Mar 16, 2015
@DeepDiver1975
DeepDiver1975 deleted the trash-expire-command branch March 16, 2015 09:04
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants