Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
fix(corda): Fix postgres missing dep on win32
Browse files Browse the repository at this point in the history
This was fixed by adding the dependency to the postgres windows zip in the
`trufflesuite/ganache-flavors` release
  • Loading branch information
davidmurdoch committed Apr 22, 2020
1 parent 977569b commit a71f5ad
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/integrations/corda/main/utils/postgres.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { promisify } = require("util");
const exists = promisify(fs.exists);

const USER = "ganache";
const config = {env: process.env, encoding: "utf8"};
const config = {env: null, encoding: "utf8"};

module.exports = (POSTGRES_PATH) => {
const pgJoin = join.bind(null, join(POSTGRES_PATH, "bin"));
Expand Down Expand Up @@ -83,10 +83,8 @@ module.exports = (POSTGRES_PATH) => {

// make sure there are no databases of ours running on this port...
await postgres.stop(port);

// TODO: figure out what postgres needs on Windows from the process.env and only supply that.
// start the postgres server
const maxConnections = Math.min(Math.max(100, schemaNames.length * 10), 1000);

const maxConnections = Math.min(Math.max(100, schemaNames.length * schemaNames.length), 10000);
await spawn(PG_CTL, ["-o", `-F -p ${port} -N ${maxConnections}`, "-D", dataDir, "-l", join(dataDir, "postgres-logfile.log"), "-w", "start"]);

try {
Expand Down

0 comments on commit a71f5ad

Please sign in to comment.