Skip to content
Merged
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 scripts/lint-automation/github-issue-creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ class GitHubIssueCreator {
}

// Add race condition protection: wait a random delay to prevent simultaneous creation
const delay = Math.floor(Math.random() * 3000) + 1000; // 1-4 seconds
console.log(`πŸ• Waiting ${Math.round(delay/1000)}s to prevent race conditions...`);
const delay = Math.floor(Math.random() * 1000) + 500; // 0.5-1.5 seconds
console.log(`πŸ• Waiting ${Math.round(delay/1000 * 10) / 10}s to prevent race conditions...`);
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

The expression Math.round(delay/1000 * 10) / 10 is a complex magic number calculation. Consider extracting this to a helper function like formatDelaySeconds(delay) or using (delay/1000).toFixed(1) for better readability.

Suggested change
console.log(`πŸ• Waiting ${Math.round(delay/1000 * 10) / 10}s to prevent race conditions...`);
console.log(`πŸ• Waiting ${(delay/1000).toFixed(1)}s to prevent race conditions...`);

Copilot uses AI. Check for mistakes.
await new Promise(resolve => setTimeout(resolve, delay));

// Final check for existing issues after delay (race condition protection)
Expand Down