Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

Change minimum time between cronjobs to 15 seconds#3198

Open
Mrtenz wants to merge 1 commit intomain from
mrtenz/cronjob-minimum-time
Open

Change minimum time between cronjobs to 15 seconds #3198
Mrtenz wants to merge 1 commit intomain from
mrtenz/cronjob-minimum-time

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

@FrederikBolding FrederikBolding Mar 5, 2025

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.

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

Reviewers

@FrederikBolding FrederikBolding FrederikBolding left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /