diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-11-16 11:40:52 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-11-19 20:14:44 +0100 |
commit | ccb05dbb170475870e755573f91da6e1914698d5 (patch) | |
tree | 440b1c24397ab39dceceb28affd3c0e4217a8ef7 /lib/private/Server.php | |
parent | b1ee9862f86d7d873f5168a921b183c5f373cc20 (diff) | |
download | nextcloud-server-ccb05dbb170475870e755573f91da6e1914698d5.tar.gz nextcloud-server-ccb05dbb170475870e755573f91da6e1914698d5.zip |
Adds background job to cleanup all previews.
* A repair step that inserts a background job for each user
* Each background job will delete for 15 seconds if it takes longer we
reschedule. This is done so instances that don't use the system cron
won't time out.
* Added tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r-- | lib/private/Server.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php index 1d3d588e9fc..0963f8feb45 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -73,6 +73,7 @@ use OC\Lockdown\LockdownManager; use OC\Mail\Mailer; use OC\Memcache\ArrayCache; use OC\Notification\Manager; +use OC\Repair\NC11\CleanPreviewsBackgroundJob; use OC\RichObjectStrings\Validator; use OC\Security\Bruteforce\Throttler; use OC\Security\CertificateManager; @@ -798,9 +799,20 @@ class Server extends ServerContainer implements IServerContainer { $c->getSystemConfig() ); }); + $this->registerService('LockdownManager', function (Server $c) { return new LockdownManager(); }); + + /* To trick DI since we don't extend the DIContainer here */ + $this->registerService(CleanPreviewsBackgroundJob::class, function (Server $c) { + return new CleanPreviewsBackgroundJob( + $c->getRootFolder(), + $c->getLogger(), + $c->getJobList(), + new TimeFactory() + ); + }); } /** |