Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
1757d016
Commit
1757d016
authored
10 years ago
by
Thomas Müller
Browse files
Options
Downloads
Plain Diff
Merge pull request #14640 from owncloud/rescanversionsonlyonce
Only rescan versions once in trashbin
parents
9a9633f8
7432c73f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/files_trashbin/lib/trashbin.php
+13
-3
13 additions, 3 deletions
apps/files_trashbin/lib/trashbin.php
with
13 additions
and
3 deletions
apps/files_trashbin/lib/trashbin.php
+
13
−
3
View file @
1757d016
...
@@ -32,6 +32,13 @@ class Trashbin {
...
@@ -32,6 +32,13 @@ class Trashbin {
// unit: percentage; 50% of available disk space/quota
// unit: percentage; 50% of available disk space/quota
const
DEFAULTMAXSIZE
=
50
;
const
DEFAULTMAXSIZE
=
50
;
/**
* Whether versions have already be rescanned during this PHP request
*
* @var bool
*/
private
static
$scannedVersions
=
false
;
public
static
function
getUidAndFilename
(
$filename
)
{
public
static
function
getUidAndFilename
(
$filename
)
{
$uid
=
\OC\Files\Filesystem
::
getOwner
(
$filename
);
$uid
=
\OC\Files\Filesystem
::
getOwner
(
$filename
);
\OC\Files\Filesystem
::
initMountPoints
(
$uid
);
\OC\Files\Filesystem
::
initMountPoints
(
$uid
);
...
@@ -825,9 +832,12 @@ class Trashbin {
...
@@ -825,9 +832,12 @@ class Trashbin {
$versions
=
array
();
$versions
=
array
();
//force rescan of versions, local storage may not have updated the cache
//force rescan of versions, local storage may not have updated the cache
/** @var \OC\Files\Storage\Storage $storage */
if
(
!
self
::
$scannedVersions
)
{
list
(
$storage
,
)
=
$view
->
resolvePath
(
'/'
);
/** @var \OC\Files\Storage\Storage $storage */
$storage
->
getScanner
()
->
scan
(
'files_trashbin'
);
list
(
$storage
,
)
=
$view
->
resolvePath
(
'/'
);
$storage
->
getScanner
()
->
scan
(
'files_trashbin/versions'
);
self
::
$scannedVersions
=
true
;
}
if
(
$timestamp
)
{
if
(
$timestamp
)
{
// fetch for old versions
// fetch for old versions
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment