Skip to content

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Mar 5, 2025

This changes the minimum time between cronjob executions to 15 seconds.

Related to: MetaMask/pm-security#392.

@Mrtenz Mrtenz requested a review from a team as a code owner March 5, 2025 15:33

// If the time until the next run is less than 15 seconds, we increase it
// to 15 seconds to avoid running jobs too frequently.
const ms = Math.max(next.getTime() - now.getTime(), 15_000);
Copy link
Member

Choose a reason for hiding this comment

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

What if the job is a job that runs every day but meant to start in 1 second?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I need to rethink my approach 😅

Copy link

codecov bot commented Mar 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.93%. Comparing base (9047dbf) to head (03d9ca5).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3198   +/-   ##
=======================================
  Coverage   94.93%   94.93%           
=======================================
  Files         507      507           
  Lines       11185    11185           
  Branches     1722     1722           
=======================================
  Hits        10619    10619           
  Misses        566      566           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ulissesferreira
Copy link

Question folks, why 15 seconds and not other lower values?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants