File manager - Edit - /usr/local/lib/node_modules/knex-migrator/node_modules/@tryghost/bunyan-rotating-filestream/lib/thresholdTrigger.js
Back
const {EventEmitter} = require('events'); const {Rotate} = require('./customEvents'); const {processSize} = require('../util/configProcessors'); class ThresholdTrigger extends EventEmitter { constructor(threshold) { super(); this._threshold = processSize(threshold); this._totalWritten = 0; } newFile(fileInfo) { this._totalWritten = fileInfo.size; if (this._totalWritten > this.threshold) { // Case where initial file is larger than threshold - usually on config change between boots this.emit(Rotate); } } updateWritten(bytes) { this._totalWritten += bytes; if (this._totalWritten > this._threshold) { this.emit(Rotate); } } shutdown() { // no-op } } module.exports = ThresholdTrigger;
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings