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

More aggressive rageshake log culling #3311

Merged
merged 2 commits into from Feb 23, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -314,17 +314,24 @@ class IndexedDBLogStore {
let size = 0;
for (let i = 0; i < allLogIds.length; i++) {
let lines = await fetchLogs(allLogIds[i]);
logs.push({
lines: lines,
id: allLogIds[i],
});
size += lines.length;
if (size > MAX_LOG_SIZE) {

// always include at least one log file, but only include
// subsequent ones if they won't take us over the MAX_LOG_SIZE
if (i > 0 && size + lines.length > MAX_LOG_SIZE) {
// the remaining log IDs should be removed. If we go out of
// bounds this is just []
//
// XXX: there's nothing stopping the current session exceeding
// MAX_LOG_SIZE. We ought to think about culling it.
removeLogIds = allLogIds.slice(i + 1);
break;
}

logs.push({
lines: lines,
id: allLogIds[i],
});
size += lines.length;
}
if (removeLogIds.length > 0) {
console.log("Removing logs: ", removeLogIds);
@@ -485,6 +492,7 @@ module.exports = {
user_agent: userAgent,
},
json: true,
timeout: 5 * 60 * 1000,
}, (err, res) => {
if (err) {
reject(err);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.