Skip to content

Commit

Permalink
moar log
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore committed Oct 17, 2024
1 parent a2c2c53 commit 10040f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/src/database/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export async function getTestHar(id) {
}
}

export async function testConnection(retries = 3, delay = 3000) {
export async function testConnection(retries = 3, delay = 5000) {
const test = 'SELECT 1 FROM sitespeed_io_test_runs';
try {
const result = await DatabaseHelper.getInstance().query(test);
Expand All @@ -158,6 +158,9 @@ export async function testConnection(retries = 3, delay = 3000) {
logError('Could not get a connection to the database', error);

if (retries > 0) {
logError(
`Retrying in ${delay / 1000} seconds... (${retries} retries left)`
);
await new Promise(resolve => setTimeout(resolve, delay));
return testConnection(retries - 1, delay);
} else {
Expand Down

0 comments on commit 10040f8

Please sign in to comment.