Skip to content

Commit

Permalink
include connectionString in message
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsdev committed Aug 27, 2023
1 parent 028860d commit 0d16135
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
10 changes: 6 additions & 4 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.

10 changes: 6 additions & 4 deletions dist/worker-wrapper.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,15 @@ var Worker = class {
message: "starting generic container instance..."
});
const startedContainer = await container.start();
const connectionString = `postgresql://postgres:@${startedContainer.getHost()}:${startedContainer.getMappedPort(
5432
)}/postgres`;
parentPort.postMessage({
type: "ava-postgres",
message: "container started",
port: startedContainer.getMappedPort(5432),
host: startedContainer.getHost()
host: startedContainer.getHost(),
connectionString
});
const { exitCode, output } = await startedContainer.exec(["pg_isready"]);
if (exitCode !== 0) {
Expand All @@ -232,9 +236,7 @@ var Worker = class {
output
});
const postgresClient = new pg.Pool({
connectionString: `postgresql://postgres:@${startedContainer.getHost()}:${startedContainer.getMappedPort(
5432
)}/postgres`
connectionString
});
postgresClient.on("error", (err) => {
parentPort.postMessage({
Expand Down
Loading

0 comments on commit 0d16135

Please sign in to comment.