Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cycode/cli/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@
SENTRY_INCLUDE_LOCAL_VARIABLES = False
SENTRY_MAX_REQUEST_BODY_SIZE = 'never'

# sync scans
SYNC_SCAN_TIMEOUT_IN_SECONDS_ENV_VAR_NAME = 'SYNC_SCAN_TIMEOUT_IN_SECONDS'
DEFAULT_SYNC_SCAN_TIMEOUT_IN_SECONDS = 180

# report with polling
REPORT_POLLING_WAIT_INTERVAL_IN_SECONDS = 5
DEFAULT_REPORT_POLLING_TIMEOUT_IN_SECONDS = 600
Expand Down
7 changes: 7 additions & 0 deletions cycode/cli/user_settings/configuration_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ def get_scan_polling_timeout_in_seconds(self) -> int:
)
)

def get_sync_scan_timeout_in_seconds(self) -> int:
return int(
self._get_value_from_environment_variables(
consts.SYNC_SCAN_TIMEOUT_IN_SECONDS_ENV_VAR_NAME, consts.DEFAULT_SYNC_SCAN_TIMEOUT_IN_SECONDS
)
)

def get_report_polling_timeout_in_seconds(self) -> int:
return int(
self._get_value_from_environment_variables(
Expand Down
3 changes: 2 additions & 1 deletion cycode/cyclient/scan_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from requests import Response

from cycode.cli import consts
from cycode.cli.config import configuration_manager
from cycode.cli.exceptions.custom_exceptions import CycodeError
from cycode.cli.files_collector.models.in_memory_zip import InMemoryZip
from cycode.cyclient import models
Expand Down Expand Up @@ -133,7 +134,7 @@ def zipped_file_scan_sync(
},
files=files,
hide_response_content_log=self._hide_response_log,
timeout=60,
timeout=configuration_manager.get_sync_scan_timeout_in_seconds(),
)
return models.ScanResultsSyncFlowSchema().load(response.json())

Expand Down
Loading