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

fix: cap log history at 1000 items #6192

Merged
merged 3 commits into from
Aug 29, 2019
Merged

fix: cap log history at 1000 items #6192

merged 3 commits into from
Aug 29, 2019

Conversation

brandonocasey
Copy link
Contributor

Description

Cap log history at 1000 items to prevent running out of memory on long videos.

@@ -33,6 +33,11 @@ const LogByTypeFactory = (name, log) => (type, level, args) => {
// Add a clone of the args at this point to history.
if (history) {
history.push([].concat(args));

// remove old history
while (history.length > 1000) {
Copy link
Member

Choose a reason for hiding this comment

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

would something like history = history.slice(-1000) work? Theoretically, should be faster as well, since we won't be shifting the entire list n times.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense to me

@gkatsev gkatsev added confirmed minor This PR can be added to a minor release. It should not be added to a patch release. labels Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed minor This PR can be added to a minor release. It should not be added to a patch release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants