Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
f6182aa8
Commit
f6182aa8
authored
10 years ago
by
Robin Appelman
Committed by
Vincent Petry
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Allow disabling the cache updater
parent
b4dfd043
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/private/files/cache/updater.php
+16
-3
16 additions, 3 deletions
lib/private/files/cache/updater.php
lib/private/files/view.php
+7
-0
7 additions, 0 deletions
lib/private/files/view.php
with
23 additions
and
3 deletions
lib/private/files/cache/updater.php
+
16
−
3
View file @
f6182aa8
...
@@ -12,6 +12,11 @@ namespace OC\Files\Cache;
...
@@ -12,6 +12,11 @@ namespace OC\Files\Cache;
* Update the cache and propagate changes
* Update the cache and propagate changes
*/
*/
class
Updater
{
class
Updater
{
/**
* @var bool
*/
protected
$enabled
=
true
;
/**
/**
* @var \OC\Files\View
* @var \OC\Files\View
*/
*/
...
@@ -30,6 +35,14 @@ class Updater {
...
@@ -30,6 +35,14 @@ class Updater {
$this
->
propagator
=
new
ChangePropagator
(
$view
);
$this
->
propagator
=
new
ChangePropagator
(
$view
);
}
}
public
function
disable
()
{
$this
->
enabled
=
false
;
}
public
function
enable
()
{
$this
->
enabled
=
true
;
}
public
function
propagate
(
$path
,
$time
=
null
)
{
public
function
propagate
(
$path
,
$time
=
null
)
{
if
(
Scanner
::
isPartialFile
(
$path
))
{
if
(
Scanner
::
isPartialFile
(
$path
))
{
return
;
return
;
...
@@ -45,7 +58,7 @@ class Updater {
...
@@ -45,7 +58,7 @@ class Updater {
* @param int $time
* @param int $time
*/
*/
public
function
update
(
$path
,
$time
=
null
)
{
public
function
update
(
$path
,
$time
=
null
)
{
if
(
Scanner
::
isPartialFile
(
$path
))
{
if
(
!
$this
->
enabled
or
Scanner
::
isPartialFile
(
$path
))
{
return
;
return
;
}
}
/**
/**
...
@@ -70,7 +83,7 @@ class Updater {
...
@@ -70,7 +83,7 @@ class Updater {
* @param string $path
* @param string $path
*/
*/
public
function
remove
(
$path
)
{
public
function
remove
(
$path
)
{
if
(
Scanner
::
isPartialFile
(
$path
))
{
if
(
!
$this
->
enabled
or
Scanner
::
isPartialFile
(
$path
))
{
return
;
return
;
}
}
/**
/**
...
@@ -97,7 +110,7 @@ class Updater {
...
@@ -97,7 +110,7 @@ class Updater {
* @param string $target
* @param string $target
*/
*/
public
function
rename
(
$source
,
$target
)
{
public
function
rename
(
$source
,
$target
)
{
if
(
Scanner
::
isPartialFile
(
$source
)
or
Scanner
::
isPartialFile
(
$target
))
{
if
(
!
$this
->
enabled
or
Scanner
::
isPartialFile
(
$source
)
or
Scanner
::
isPartialFile
(
$target
))
{
return
;
return
;
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
lib/private/files/view.php
+
7
−
0
View file @
f6182aa8
...
@@ -1528,4 +1528,11 @@ class View {
...
@@ -1528,4 +1528,11 @@ class View {
$mount
$mount
);
);
}
}
/**
* @return Updater
*/
public
function
getUpdater
(){
return
$this
->
updater
;
}
}
}
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