Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion shared/db/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const IS_PROD = !process.env.FORCE_DEV && process.env.NODE_ENV === 'production';
const DEFAULT_CONFIG = {
// Connect to the test database when, well, testing
db: !process.env.TEST_DB ? 'spectrum' : 'testing',
max: 20, // Maximum number of connections, default is 1000
max: 60, // Maximum number of connections, default is 1000
buffer: 1, // Minimum number of connections open at any given moment, default is 50
timeoutGb: 60 * 1000, // How long should an unused connection stick around, default is an hour, this is a minute
};
Expand Down
19 changes: 10 additions & 9 deletions shared/middlewares/toobusy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ export default (
res: express$Response | http$ServerResponse,
next: express$NextFunction | (() => void)
) => {
// Don't send 503s in testing, that's dumb, just wait it out
if (process.env.NODE_ENV !== 'testing' && !process.env.TEST_DB && toobusy()) {
res.statusCode = 503;
res.end(
'It looks like Spectrum is very busy right now, please try again in a minute.'
);
} else {
next();
}
next();
// // Don't send 503s in testing, that's dumb, just wait it out
// if (process.env.NODE_ENV !== 'testing' && !process.env.TEST_DB && toobusy()) {
// res.statusCode = 503;
// res.end(
// 'It looks like Spectrum is very busy right now, please try again in a minute.'
// );
// } else {
// next();
// }
};