Skip to content

Commit

Permalink
include psutil for process memory management
Browse files Browse the repository at this point in the history
  • Loading branch information
james-jdgtl committed Mar 3, 2025
1 parent e53d995 commit dc08714
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion health_ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""Health ping - fetches all /health and /info endpoints and stores the results in Redis"""

from datetime import datetime, timezone
import psutil
import os
import threading
import logging
Expand Down Expand Up @@ -32,6 +33,7 @@
GITHUB_APP_INSTALLATION_ID = int(os.getenv('GITHUB_APP_INSTALLATION_ID'))
GITHUB_APP_PRIVATE_KEY = os.getenv('GITHUB_APP_PRIVATE_KEY')


# limit results for testing/dev
# See strapi filter syntax https://docs.strapi.io/dev-docs/api/rest/filters-locale-publication
# Example filter string = '&filters[name][$contains]=example'
Expand Down Expand Up @@ -267,7 +269,7 @@ def startHttpServer():
format='[%(asctime)s] %(levelname)s %(threadName)s %(message)s', level=log_level
)
log = logging.getLogger(__name__)

process = psutil.Process(os.getpid())
main_threads = list()
http_thread = list()
# Start health endpoint.
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
redis==4.6.0
requests==2.31.0
PyGithub==1.59.1
psutil>=7.0.0

0 comments on commit dc08714

Please sign in to comment.