(err, stats)
| 559 | * @param {Stats=} stats stats |
| 560 | */ |
| 561 | const finalCallback = (err, stats) => { |
| 562 | if (logger) logger.time("beginIdle"); |
| 563 | this.idle = true; |
| 564 | this.cache.beginIdle(); |
| 565 | if (logger) logger.timeEnd("beginIdle"); |
| 566 | this.running = false; |
| 567 | if (err) { |
| 568 | this.hooks.failed.call(err); |
| 569 | } |
| 570 | if (callback !== undefined) callback(err, stats); |
| 571 | this.hooks.afterDone.call(/** @type {Stats} */ (stats)); |
| 572 | }; |
| 573 | |
| 574 | const startTime = Date.now(); |
| 575 |