diff options
| author | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2024-07-14 12:01:30 +0200 |
|---|---|---|
| committer | Guru <alexandrgproductengine@lindenlab.com> | 2024-07-18 09:42:59 +0200 |
| commit | ef9a494134458f3464b250c87da9e247d775989c (patch) | |
| tree | 12bc85b249dbc9a16afe3d4ded58983f4c154ed0 /indra/llcommon/llapp.cpp | |
| parent | 88f52f1b90af1813dc70525f2e08b16cc5939af5 (diff) | |
#1500 Better out of disk space handling
Diffstat (limited to 'indra/llcommon/llapp.cpp')
| -rw-r--r-- | indra/llcommon/llapp.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index b85bd2573b..c2158bb5b8 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -487,6 +487,33 @@ int LLApp::getPid() #endif } +// static +void LLApp::notifyOutOfDiskSpace() +{ + static const U32Seconds min_interval = U32Seconds(60); + static U32Seconds min_time_to_send = U32Seconds(0); + U32Seconds now = LLTimer::getTotalTime(); + if (now < min_time_to_send) + return; + + min_time_to_send = now + min_interval; + + if (LLApp* app = instance()) + { + app->sendOutOfDiskSpaceNotification(); + } + else + { + LL_WARNS() << "No app instance" << LL_ENDL; + } +} + +// virtual +void LLApp::sendOutOfDiskSpaceNotification() +{ + LL_WARNS() << "Should never be called" << LL_ENDL; // Should be overridden +} + #ifndef LL_WINDOWS void setup_signals() { |
