fix FileSystemInfo logging when multiple different types of invalidation occur
This commit is contained in:
parent
c124637646
commit
6172b61938
|
@ -255,10 +255,11 @@ class FileSystemInfo {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
_log(path, reason) {
|
_log(path, reason, ...args) {
|
||||||
if (this._loggedPaths.has(path)) return;
|
const key = path + reason;
|
||||||
this._loggedPaths.add(path);
|
if (this._loggedPaths.has(key)) return;
|
||||||
this.logger.debug(`${path} invalidated because ${reason}`);
|
this._loggedPaths.add(key);
|
||||||
|
this.logger.debug(`${path} invalidated because ${reason}`, ...args);
|
||||||
if (--this._remainingLogs === 0) {
|
if (--this._remainingLogs === 0) {
|
||||||
this.logger.debug(
|
this.logger.debug(
|
||||||
"Logging limit has been reached and no futher logging will be emitted by FileSystemInfo"
|
"Logging limit has been reached and no futher logging will be emitted by FileSystemInfo"
|
||||||
|
@ -1013,7 +1014,7 @@ class FileSystemInfo {
|
||||||
};
|
};
|
||||||
const invalidWithError = (path, err) => {
|
const invalidWithError = (path, err) => {
|
||||||
if (this._remainingLogs > 0) {
|
if (this._remainingLogs > 0) {
|
||||||
this._log(path, `error occured: ${err}`);
|
this._log(path, `error occured: %s`, err);
|
||||||
}
|
}
|
||||||
invalid();
|
invalid();
|
||||||
};
|
};
|
||||||
|
@ -1035,7 +1036,7 @@ class FileSystemInfo {
|
||||||
if (current !== snap) {
|
if (current !== snap) {
|
||||||
// If hash differ it's invalid
|
// If hash differ it's invalid
|
||||||
if (this._remainingLogs > 0) {
|
if (this._remainingLogs > 0) {
|
||||||
this._log(path, `hashes differ (${current} != ${snap})`);
|
this._log(path, `hashes differ (%s != %s)`, current, snap);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1097,7 +1098,9 @@ class FileSystemInfo {
|
||||||
if (this._remainingLogs > 0) {
|
if (this._remainingLogs > 0) {
|
||||||
this._log(
|
this._log(
|
||||||
path,
|
path,
|
||||||
`it may have changed (${current.safeTime}) after the start time of the snapshot (${startTime})`
|
`it may have changed (%d) after the start time of the snapshot (%d)`,
|
||||||
|
current.safeTime,
|
||||||
|
startTime
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -1124,7 +1127,9 @@ class FileSystemInfo {
|
||||||
if (this._remainingLogs > 0) {
|
if (this._remainingLogs > 0) {
|
||||||
this._log(
|
this._log(
|
||||||
path,
|
path,
|
||||||
`timestamps differ (${current.timestamp} != ${snap.timestamp})`
|
`timestamps differ (%d != %d)`,
|
||||||
|
current.timestamp,
|
||||||
|
snap.timestamp
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -1138,7 +1143,9 @@ class FileSystemInfo {
|
||||||
if (this._remainingLogs > 0) {
|
if (this._remainingLogs > 0) {
|
||||||
this._log(
|
this._log(
|
||||||
path,
|
path,
|
||||||
`timestamps hashes differ (${current.timestampHash} != ${snap.timestampHash})`
|
`timestamps hashes differ (%s != %s)`,
|
||||||
|
current.timestampHash,
|
||||||
|
snap.timestampHash
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue