Skip to content

BUG: Setting DEJACODE_INTEGRATION_REQUESTS_TIMEOUT results in connection issues #525

@rogu-beta

Description

@rogu-beta

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:

  1. Set DEJACODE_INTEGRATION_REQUESTS_TIMEOUT
  2. Run "Scan All Packages" on a prodct
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdesign neededDesign details needed to complete the issueenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions