mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
don't take network time into account in sync log filter
This commit is contained in:
parent
f2f9162b85
commit
ad0c813833
@ -45,6 +45,22 @@ export class LogItem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
durationWithoutType(type) {
|
||||||
|
return this.duration - this.durationOfType(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
durationOfType(type) {
|
||||||
|
if (this._values.t === type) {
|
||||||
|
return this.duration;
|
||||||
|
} else if (this._children) {
|
||||||
|
return this._children.reduce((sum, c) => {
|
||||||
|
return sum + c.durationOfType(type);
|
||||||
|
}, 0);
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new child item that finishes immediately
|
* Creates a new child item that finishes immediately
|
||||||
* and can hence not be modified anymore.
|
* and can hence not be modified anymore.
|
||||||
|
@ -96,7 +96,7 @@ export class Sync {
|
|||||||
while(this._status.get() !== SyncStatus.Stopped) {
|
while(this._status.get() !== SyncStatus.Stopped) {
|
||||||
let roomStates;
|
let roomStates;
|
||||||
let sessionChanges;
|
let sessionChanges;
|
||||||
let wasCatchup = this._status.get() === SyncStatus.CatchupSync;
|
let wasCatchupOrInitial = this._status.get() === SyncStatus.CatchupSync || this._status.get() === SyncStatus.InitialSync;
|
||||||
await this._logger.run("sync", async log => {
|
await this._logger.run("sync", async log => {
|
||||||
log.set("token", syncToken);
|
log.set("token", syncToken);
|
||||||
log.set("status", this._status.get());
|
log.set("status", this._status.get());
|
||||||
@ -150,7 +150,7 @@ export class Sync {
|
|||||||
},
|
},
|
||||||
this._logger.level.Info,
|
this._logger.level.Info,
|
||||||
(filter, log) => {
|
(filter, log) => {
|
||||||
if (log.duration >= 2000 || log.error || wasCatchup) {
|
if (log.durationWithoutType("network") >= 2000 || log.error || wasCatchupOrInitial) {
|
||||||
return filter.minLevel(log.level.Detail);
|
return filter.minLevel(log.level.Detail);
|
||||||
} else {
|
} else {
|
||||||
return filter.minLevel(log.level.Info);
|
return filter.minLevel(log.level.Info);
|
||||||
|
Loading…
Reference in New Issue
Block a user