Skip to content

Modify calculate response size logic for mongoengine queryset #172

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 2 commits into from
Apr 15, 2025

Conversation

ImMin5
Copy link
Member

@ImMin5 ImMin5 commented Apr 15, 2025

Category

  • New feature
  • Bug fix
  • Improvement
  • Refactor
  • etc

Description

  • modify calculate response size logic for mongoengine queryset

Known issue

ImMin5 and others added 2 commits April 15, 2025 10:05
Signed-off-by: Jongmin Kim <whdalsrnt@megazone.com>
@ImMin5 ImMin5 added the enhancement New feature or request label Apr 15, 2025
@ImMin5 ImMin5 requested a review from Copilot April 15, 2025 01:07
@ImMin5 ImMin5 self-assigned this Apr 15, 2025
@ImMin5 ImMin5 merged commit 096a31d into cloudforet-io:master Apr 15, 2025
1 check passed
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/spaceone/core/service/init.py:277

  • Ensure the tuple is not empty before accessing its first element to avoid an IndexError. Consider adding a check for tuple length.
if isinstance(response_or_iterator, tuple):

self._request_map = request_map
self._channel_key = channel_key
self.metadata = options.get("metadata", {})
self.timeout = timeout or 60
Copy link
Preview

Copilot AI Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If timeout is explicitly set to 0, this expression defaults to 60 due to the falsy check; consider using an explicit check against None to allow valid zero timeouts.

Suggested change
self.timeout = timeout or 60
self.timeout = 60 if timeout is None else timeout

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pass/signedoff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant