Describe the bug
Setting the environment variable DEJACODE_INTEGRATION_REQUESTS_TIMEOUT results in connection issues. This happens because the environment variable is attempted to be read in
|
REQUESTS_TIMEOUT = get_settings("DEJACODE_INTEGRATION_REQUESTS_TIMEOUT", default=5) |
which calls
get_settings. The function calls
getenv which returns a string instead of an int. This means if the environment variable is set, then
REQUESTS_TIMEOUT will contain a string, instead of an int. The resulting exception in the worker is:
ERROR ScanCode.io [Exception] Timeout value connect was 60, but it must be an int, float or None.
To Reproduce
Steps to reproduce the behavior:
- Set
DEJACODE_INTEGRATION_REQUESTS_TIMEOUT
- Run "Scan All Packages" on a prodct
- Observe the log of the worker
Expected behavior
No exception is raised an timeout works.
Screenshots
n.a.
Context (OS, Browser, Device, etc.):
n.a.
Describe the bug
Setting the environment variable
DEJACODE_INTEGRATION_REQUESTS_TIMEOUTresults in connection issues. This happens because the environment variable is attempted to be read indejacode/dejacode_toolkit/__init__.py
Line 24 in c56d8fb
get_settings. The function callsgetenvwhich returns a string instead of an int. This means if the environment variable is set, thenREQUESTS_TIMEOUTwill contain a string, instead of an int. The resulting exception in the worker is:ERROR ScanCode.io [Exception] Timeout value connect was 60, but it must be an int, float or None.To Reproduce
Steps to reproduce the behavior:
DEJACODE_INTEGRATION_REQUESTS_TIMEOUTExpected behavior
No exception is raised an timeout works.
Screenshots
n.a.
Context (OS, Browser, Device, etc.):
n.a.