Skip to content

Conversation

@StephDriver
Copy link
Member

when using dev-settings on mac, we get the following error:
AttributeError: module 'resource' has no attribute 'RUSAGE_THREAD'

previously addressed by manually removing "utils.middleware.TimeMonitoring", from these settings each time it was installed on mac.

This try/catch addresses this directly.

@StephDriver StephDriver marked this pull request as ready for review September 5, 2025 13:22
@StephDriver StephDriver requested a review from ajrbyers September 5, 2025 13:22
Copy link
Member

@ajrbyers ajrbyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment.

try:
utime, stime, *_ = resource.getrusage(resource.RUSAGE_THREAD)
except AttributeError:
utime, stime, *_ = resource.getrusage(resource.RUSAGE_SELF)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a broad exception here so that this middleware (which is DEBUG only anyway) never kills the process.

@ajrbyers ajrbyers assigned StephDriver and unassigned ajrbyers Oct 23, 2025
@StephDriver StephDriver requested a review from ajrbyers November 11, 2025 10:01
@StephDriver StephDriver assigned ajrbyers and unassigned StephDriver Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants