Open joemull opened 1 month ago
The TimeMonitoring middleware does not work on Darwin / Mac OSX due to an unavailable attribute resource.RUSAGE_THREAD.
resource.RUSAGE_THREAD
https://github.com/openlibhums/janeway/blob/30fb420ab695d542962770d35f83e7059e9c9c22/src/utils/middleware.py#L76-L79
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.
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.