Closed sweep-ai[bot] closed 2 months ago
[!IMPORTANT]
Review skipped
Auto reviews are disabled on base/target branches other than the default branch.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yaml
file in this repository. To trigger a single review, invoke the@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This pull request was created by Sweep to resolve the following request by @KristopherKubicki:
Continue chatting at https://sweep-chat-demo.vercel.app/c/b1611879-8735-4256-bafe-d759a3100d30.
Purpose
This pull request implements a more graceful shutdown process for the Glimpser application. When the user terminates the application using Ctrl+C, the application will display system metrics, including CPU usage, memory usage, disk usage, open files, thread count, and uptime, before shutting down.
Description
The changes are made in the
app/__init__.py
file, where thegraceful_shutdown
function is modified to retrieve and display the system metrics using theget_system_metrics
function from theapp/utils/scheduling.py
file. Additionally, theget_system_metrics
function is imported in theapp/__init__.py
file.Summary
graceful_shutdown
function inapp/__init__.py
to display system metrics before shutting down the applicationget_system_metrics
function fromapp/utils/scheduling.py
inapp/__init__.py
shutdown_flag
to prevent multiple shutdown calls