mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
Reduce rageshake log size to 1MB
... 50MB turned out to be quite a lot.
This commit is contained in:
parent
338ab4d046
commit
15ab1732a2
@ -37,8 +37,12 @@ import q from "q";
|
|||||||
// actually timestamps. We then purge the remaining logs. We also do this
|
// actually timestamps. We then purge the remaining logs. We also do this
|
||||||
// purge on startup to prevent logs from accumulating.
|
// purge on startup to prevent logs from accumulating.
|
||||||
|
|
||||||
|
// the frequency with which we flush to indexeddb
|
||||||
const FLUSH_RATE_MS = 30 * 1000;
|
const FLUSH_RATE_MS = 30 * 1000;
|
||||||
|
|
||||||
|
// the length of log data we keep in indexeddb (and include in the reports)
|
||||||
|
const MAX_LOG_SIZE = 1024 * 1024 * 1; // 1 MB
|
||||||
|
|
||||||
// A class which monkey-patches the global console and stores log lines.
|
// A class which monkey-patches the global console and stores log lines.
|
||||||
class ConsoleLogger {
|
class ConsoleLogger {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -232,7 +236,6 @@ class IndexedDBLogStore {
|
|||||||
* is a big string with all the new-line delimited logs.
|
* is a big string with all the new-line delimited logs.
|
||||||
*/
|
*/
|
||||||
async consume() {
|
async consume() {
|
||||||
const MAX_LOG_SIZE = 1024 * 1024 * 50; // 50 MB
|
|
||||||
const db = this.db;
|
const db = this.db;
|
||||||
|
|
||||||
// Returns: a string representing the concatenated logs for this ID.
|
// Returns: a string representing the concatenated logs for this ID.
|
||||||
|
Loading…
Reference in New Issue
Block a user