Skip to content

fix(perf): default worker counts#480

Merged
9aoy merged 1 commit intomainfrom
fix-worker-count
Aug 15, 2025
Merged

fix(perf): default worker counts#480
9aoy merged 1 commit intomainfrom
fix-worker-count

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Aug 15, 2025

Summary

fix default worker counts when calc by entry counts.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings August 15, 2025 07:12
@netlify
Copy link
Copy Markdown

netlify bot commented Aug 15, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 9a35be3
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/689edddae8c19700073c0c22
😎 Deploy Preview https://deploy-preview-480--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

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.

Pull Request Overview

This PR fixes a bug in the default worker count calculation where the wrong property was being accessed when reducing over entry counts. The code was attempting to get the length of entries directly instead of accessing the entries property of each entry object.

  • Corrects property access in the worker count calculation logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

? Number.POSITIVE_INFINITY
: Array.from(entriesCache.values()).reduce(
(acc, entries) => acc + Object.keys(entries).length,
(acc, entry) => acc + Object.keys(entry.entries).length,
Copy link

Copilot AI Aug 15, 2025

Choose a reason for hiding this comment

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

This fix assumes that each entry has an 'entries' property, but the original code suggested that the values from entriesCache were directly the entries objects. Please verify that the structure of entriesCache values actually contains an 'entries' property, as this change could introduce a runtime error if the property doesn't exist.

Suggested change
(acc, entry) => acc + Object.keys(entry.entries).length,
(acc, entry) => acc + (entry && entry.entries && typeof entry.entries === 'object' ? Object.keys(entry.entries).length : 0),

Copilot uses AI. Check for mistakes.
@9aoy 9aoy merged commit 9b580ed into main Aug 15, 2025
16 checks passed
@9aoy 9aoy deleted the fix-worker-count branch August 15, 2025 07:22
@9aoy 9aoy mentioned this pull request Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants