diff options
| author | Ansariel <ansariel.hiller@phoenixviewer.com> | 2021-05-12 10:45:23 +0200 |
|---|---|---|
| committer | Ansariel <ansariel.hiller@phoenixviewer.com> | 2021-05-12 10:45:23 +0200 |
| commit | 0e253cb9098cb58b2f3528860a5fd9f00ec5af96 (patch) | |
| tree | e74f2c0b553478c5304789a86147176db271f4e6 /indra/llfilesystem/lldiskcache.cpp | |
| parent | c241c5d4b8007793cb4b5f5e54fa3883aad3dad5 (diff) | |
BUG-230673: Trim asset disk cache regularly
Diffstat (limited to 'indra/llfilesystem/lldiskcache.cpp')
| -rw-r--r-- | indra/llfilesystem/lldiskcache.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp index 02678864b9..68423cc4f8 100644 --- a/indra/llfilesystem/lldiskcache.cpp +++ b/indra/llfilesystem/lldiskcache.cpp @@ -335,3 +335,25 @@ uintmax_t LLDiskCache::dirFileSize(const std::string dir) return total_file_size; } + +LLPurgeDiskCacheThread::LLPurgeDiskCacheThread() : + LLThread("PurgeDiskCacheThread", nullptr) +{ +} + +void LLPurgeDiskCacheThread::run() +{ + constexpr F64 CHECK_INTERVAL = 60; + mTimer.setTimerExpirySec(CHECK_INTERVAL); + mTimer.start(); + + do + { + if (mTimer.checkExpirationAndReset(CHECK_INTERVAL)) + { + LLDiskCache::instance().purge(); + } + + ms_sleep(100); + } while (!isQuitting()); +}
\ No newline at end of file |
