Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsdev committed Aug 27, 2023
1 parent 75991b5 commit 028860d
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 12 deletions.
38 changes: 33 additions & 5 deletions dist/worker-wrapper.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/worker-wrapper.js.map

Large diffs are not rendered by default.

38 changes: 33 additions & 5 deletions dist/worker-wrapper.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,42 @@ var Worker = class {
exitCode,
output
});
const postgresClient = new pg.Pool({
connectionString: `postgresql://postgres:@${startedContainer.getHost()}:${startedContainer.getMappedPort(
5432
)}/postgres`
});
postgresClient.on("error", (err) => {
parentPort.postMessage({
type: "ava-postgres",
message: "postgres client error",
errMessage: err.message,
stack: err.stack
});
});
const heartbeat = async () => {
try {
const { rows } = await postgresClient.query("SELECT 1");
parentPort.postMessage({
type: "ava-postgres",
message: "postgres heartbeat success",
rows
});
} catch (err) {
parentPort.postMessage({
type: "ava-postgres",
message: "postgres heartbeat failure",
errMessage: err.message,
stack: err.stack
});
}
setTimeout(heartbeat, 5e3);
};
heartbeat();
return {
container: startedContainer,
network,
postgresClient: new pg.Pool({
connectionString: `postgresql://postgres:@${startedContainer.getHost()}:${startedContainer.getMappedPort(
5432
)}/postgres`
})
postgresClient
};
}
};
Expand Down
2 changes: 1 addition & 1 deletion dist/worker-wrapper.mjs.map

Large diffs are not rendered by default.

0 comments on commit 028860d

Please sign in to comment.