Skip to content

Commit

Permalink
Introduce a config parameter to have an instance-level quota
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
  • Loading branch information
tcitworld committed Jul 13, 2022
1 parent 62fad09 commit 01742d9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/private/Files/Storage/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
use OCP\Files\Storage\ILockingStorage;
use OCP\Files\Storage\IStorage;
use OCP\Files\Storage\IWriteStreamStorage;
use OCP\IConfig;
use OCP\Lock\ILockingProvider;
use OCP\Lock\LockedException;
use Psr\Log\LoggerInterface;
Expand Down Expand Up @@ -480,6 +481,12 @@ public function test() {
* @return int|false
*/
public function free_space($path) {
/** @var IConfig $config */
$config = \OC::$server->get(IConfig::class);
$configQuota = (int) $config->getAppValue('core', 'quota_instance_global', '0');
if ($configQuota > 0) {
return $configQuota;
}
return \OCP\Files\FileInfo::SPACE_UNKNOWN;
}

Expand Down

0 comments on commit 01742d9

Please sign in to comment.