Skip to content

timeout fixes and fallback for missing directDeps key #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 14, 2025
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: 2 additions & 2 deletions socketdev/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
encoded_key: str

api_url = "https://api.socket.dev/v0"
request_timeout = 30
request_timeout = 1200
log = logging.getLogger("socketdev")
log.addHandler(logging.NullHandler())


class socketdev:
def __init__(self, token: str, timeout: int = 30):
def __init__(self, token: str, timeout: int = 1200):
self.api = API()
self.token = token + ":"
self.api.encode_key(self.token)
Expand Down
4 changes: 2 additions & 2 deletions socketdev/fullscans/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,9 @@ def from_dict(cls, data: dict) -> "CommitInfo":
class FullScanDiffReport:
before: CommitInfo
after: CommitInfo
directDependenciesChanged: bool
diff_report_url: str
artifacts: DiffArtifacts
directDependenciesChanged: bool = False

def __getitem__(self, key): return getattr(self, key)
def to_dict(self): return asdict(self)
Expand All @@ -518,7 +518,7 @@ def from_dict(cls, data: dict) -> "FullScanDiffReport":
return cls(
before=CommitInfo.from_dict(data["before"]),
after=CommitInfo.from_dict(data["after"]),
directDependenciesChanged=data["directDependenciesChanged"],
directDependenciesChanged=data.get("directDependenciesChanged", False),
diff_report_url=data["diff_report_url"],
artifacts=DiffArtifacts.from_dict(data["artifacts"])
)
Expand Down
2 changes: 1 addition & 1 deletion socketdev/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.0.4"
__version__ = "2.0.5"
Loading