mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Improved Storage garbage collection
Improved RecRmDir() and RecTimeDirRemove()
This commit is contained in:
parent
7df3ed665d
commit
5b4d34d1cb
6 changed files with 52 additions and 32 deletions
|
|
@ -26,7 +26,7 @@ class DemoStorage extends \RainLoop\Providers\Storage\FileStorage
|
|||
// Garbage collection
|
||||
if (!static::$gc_done) {
|
||||
static::$gc_done = true;
|
||||
if (\is_dir($sDataPath) && 0 === \random_int(0, 100)) {
|
||||
if (!\random_int(0, \max(50, \ini_get('session.gc_divisor')))) {
|
||||
\MailSo\Base\Utils::RecTimeDirRemove($sDataPath, 3600 * 3); // 3 hours
|
||||
}
|
||||
}
|
||||
|
|
@ -37,7 +37,6 @@ class DemoStorage extends \RainLoop\Providers\Storage\FileStorage
|
|||
} else if (StorageType::SESSION === $iStorageType) {
|
||||
$sDataPath .= '/.sessions';
|
||||
}
|
||||
\is_dir($sDataPath) || \mkdir($sDataPath, 0700, true);
|
||||
|
||||
return $sDataPath . '/' . ($sKey ? \RainLoop\Utils::fixName($sKey) : '');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue