You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
try to make mock-request logging saner
This commit is contained in:
@@ -49,17 +49,17 @@ HttpBackend.prototype = {
|
|||||||
const tryFlush = function() {
|
const tryFlush = function() {
|
||||||
// if there's more real requests and more expected requests, flush 'em.
|
// if there's more real requests and more expected requests, flush 'em.
|
||||||
console.log(
|
console.log(
|
||||||
" trying to flush queue => reqs=%s expected=%s [%s]",
|
" trying to flush queue => reqs=[%s] expected=[%s]",
|
||||||
self.requests.length, self.expectedRequests.length, path,
|
self.requests, self.expectedRequests.map((er) => er.path),
|
||||||
);
|
);
|
||||||
if (self._takeFromQueue(path)) {
|
if (self._takeFromQueue(path)) {
|
||||||
// try again on the next tick.
|
// try again on the next tick.
|
||||||
console.log(" flushed. Trying for more. [%s]", path);
|
|
||||||
flushed += 1;
|
flushed += 1;
|
||||||
if (numToFlush && flushed === numToFlush) {
|
if (numToFlush && flushed === numToFlush) {
|
||||||
console.log(" [%s] Flushed assigned amount: %s", path, numToFlush);
|
console.log(" Flushed assigned amount: %s", numToFlush);
|
||||||
defer.resolve();
|
defer.resolve();
|
||||||
} else {
|
} else {
|
||||||
|
console.log(" flushed. Trying for more.");
|
||||||
setTimeout(tryFlush, 0);
|
setTimeout(tryFlush, 0);
|
||||||
}
|
}
|
||||||
} else if (flushed === 0 && !triedWaiting) {
|
} else if (flushed === 0 && !triedWaiting) {
|
||||||
@@ -68,7 +68,7 @@ HttpBackend.prototype = {
|
|||||||
setTimeout(tryFlush, 5);
|
setTimeout(tryFlush, 5);
|
||||||
triedWaiting = true;
|
triedWaiting = true;
|
||||||
} else {
|
} else {
|
||||||
console.log(" no more flushes. [%s]", path);
|
console.log(" no more flushes.");
|
||||||
defer.resolve();
|
defer.resolve();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user