Skip to content
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

Change minimum time between cronjobs to 15 seconds #3198

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

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.

2 participants