janeway icon indicating copy to clipboard operation
janeway copied to clipboard

Dev middleware TimeMonitoring does not work on Macs

Open joemull opened this issue 4 months ago • 0 comments

Problem

The TimeMonitoring middleware does not work on Darwin / Mac OSX due to an unavailable attribute resource.RUSAGE_THREAD.

https://github.com/openlibhums/janeway/blob/30fb420ab695d542962770d35f83e7059e9c9c22/src/utils/middleware.py#L76-L79

Proposed solution

Add a try / except to catch the attribute error, and try to fetch the appropriate Darwin resource. If that does not work, exit the middleware gracefully but allow Janeway to run.

joemull avatar Oct 18 '24 11:10 joemull