Repository navigation
Closed
Labels
Milestone
Description
Currently the cleanup of the upload folder is run as a login hook:
Lines 808 to 834 in 20f1f75
| $userSession->listen('\OC\User', 'postLogin', function () use ($userSession) { | |
| if (!defined('PHPUNIT_RUN')) { | |
| // reset brute force delay for this IP address and username | |
| $uid = \OC::$server->getUserSession()->getUser()->getUID(); | |
| $request = \OC::$server->getRequest(); | |
| $throttler = \OC::$server->getBruteForceThrottler(); | |
| $throttler->resetDelay($request->getRemoteAddress(), 'login', ['user' => $uid]); | |
| } | |
| try { | |
| $cache = new \OC\Cache\File(); | |
| $cache->gc(); | |
| } catch (\OC\ServerNotAvailableException $e) { | |
| // not a GC exception, pass it on | |
| throw $e; | |
| } catch (\OC\ForbiddenException $e) { | |
| // filesystem blocked for this request, ignore | |
| } catch (\Exception $e) { | |
| // a GC exception should not prevent users from using OC, | |
| // so log the exception | |
| \OC::$server->getLogger()->logException($e, [ | |
| 'message' => 'Exception when running cache gc.', | |
| 'level' => \OCP\Util::WARN, | |
| 'app' => 'core', | |
| ]); | |
| } | |
| }); |
We should do this as a background job.
@icewind1991 @rullzer @nickvergessen Opinions?
Should issues like #8753
Reacted by marcos-guerrero, Joas Schilling, Roeland Jago Douma, Dino Angelov, Thibault Molleman and Ben Schumacher
Activity
rullzer commentedon Mar 9, 2018
Yes we should!
MorrisJobke commentedon Jun 25, 2018
The problem with this is that it is required to be on login to have a valid user session as it sets up the view.
@icewind1991 Is there a way to set this up without the current session? Could you point me at some code that does this so I can come up with a first draft of the fix. Would love to have this fixed in 14 finally.
Santobert commentedon Oct 23, 2018
I noticed a user with more than 20 GB used disk space and a quota of 5 GB. The folder username/uploads needs about 15-20 GB. The command
[...] occ files:cleanupdoesn't change anything.After I have deleted most of his files (he knows about it ;) ), his personal files take about 40 MB. The upload folder is shrunk to 15 GB.
Does this situation have anything to do with this ticket? How can I clean up the upload folder?
MorrisJobke commentedon Oct 24, 2018
The user should logout and login again. Then a cleanup is triggered.
MorrisJobke commentedon Jan 7, 2019
Most of this is addressed in #12227
MorrisJobke commentedon Feb 25, 2019
Let's close it as it is now.
krakazyabra commentedon May 27, 2021
Hello. Are there any news about this issue? I'm using S3 and, seems, unfinished uploads persist even after logout/login.