Skip to content
Snippets Groups Projects
Unverified Commit c4c77836 authored by syuilo's avatar syuilo
Browse files

[Server] Enable slow option

parent d6dba7fd
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ program
.option('--no-daemons', 'Disable daemon processes (for debbuging)')
.option('--disable-clustering', 'Disable clustering')
.option('--quiet', 'Suppress all logs')
.option('--slow', 'Delay all requests (for debbuging)')
.parse(process.argv);
export { program };
......@@ -13,7 +13,7 @@ import * as mount from 'koa-mount';
import * as compress from 'koa-compress';
import * as koaLogger from 'koa-logger';
import * as requestStats from 'request-stats';
//import * as slow from 'koa-slow';
import * as slow from 'koa-slow';
import activityPub from './activitypub';
import webFinger from './webfinger';
......@@ -23,6 +23,7 @@ import apiServer from './api';
import { sum } from '../prelude/array';
import User from '../models/user';
import Logger from '../misc/logger';
import { program } from '../argv';
export const serverLogger = new Logger('server', 'gray');
......@@ -37,9 +38,11 @@ if (!['production', 'test'].includes(process.env.NODE_ENV)) {
}));
// Delay
//app.use(slow({
// delay: 1000
//}));
if (program.slow) {
app.use(slow({
delay: 3000
}));
}
}
// Compress response
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment