Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
QUIQQER
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
163
Issues
163
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QUIQQER
QUIQQER
Commits
c2b3a5d7
Verified
Commit
c2b3a5d7
authored
Dec 20, 2018
by
Jan Wennrich
🏡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: Media utils folder methods return null if no value is in cache
parent
c0482a54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
lib/QUI/Projects/Media/Utils.php
lib/QUI/Projects/Media/Utils.php
+6
-8
No files found.
lib/QUI/Projects/Media/Utils.php
View file @
c2b3a5d7
...
...
@@ -927,6 +927,7 @@ class Utils
/**
* Returns the size of the given project's media folder in bytes.
* By default the value is returned from cache.
* If there is no value in cache, null is returned, unless you use the force parameter.
* Only if you really need to get a freshly calculated result, you may set the force parameter to true.
* When using the force parameter expect timeouts since the calculation could take a lot of time.
*
...
...
@@ -942,12 +943,10 @@ class Utils
}
try
{
$cacheSize
=
QUI\Cache\Manager
::
get
(
self
::
CACHE_KEY_MEDIA_FOLDER_SIZE_PREFIX
.
$Project
->
getName
());
return
QUI\Cache\Manager
::
get
(
self
::
CACHE_KEY_MEDIA_FOLDER_SIZE_PREFIX
.
$Project
->
getName
());
}
catch
(
QUI\Cache\Exception
$Exception
)
{
$cacheSize
=
self
::
calculateMediaFolderSizeForProject
(
$Project
)
;
return
null
;
}
return
$cacheSize
;
}
...
...
@@ -1009,6 +1008,7 @@ class Utils
/**
* Returns the size of the given project's media cache folder in bytes.
* By default the value is returned from cache.
* If there is no value in cache, null is returned, unless you use the force parameter.
* Only if you really need to get a freshly calculated result, you may set the force parameter to true.
* When using the force parameter expect timeouts since the calculation could take a lot of time.
*
...
...
@@ -1024,12 +1024,10 @@ class Utils
}
try
{
$cacheSize
=
QUI\Cache\Manager
::
get
(
self
::
CACHE_KEY_MEDIA_CACHE_FOLDER_SIZE_PREFIX
.
$Project
->
getName
());
return
QUI\Cache\Manager
::
get
(
self
::
CACHE_KEY_MEDIA_CACHE_FOLDER_SIZE_PREFIX
.
$Project
->
getName
());
}
catch
(
QUI\Cache\Exception
$Exception
)
{
$cacheSize
=
self
::
calculateMediaCacheFolderSizeForProject
(
$Project
)
;
return
null
;
}
return
$cacheSize
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment