Skip to content

Commit

Permalink
Add application_name to pg connection options
Browse files Browse the repository at this point in the history
  • Loading branch information
big213 committed Apr 1, 2021
1 parent 0cfe9bd commit eb954c4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/functions/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export const isDev = process.env.DEV;

export const env = isDev ? require("../../../env.json") : functions.config();

const now = new Date().toTimeString(); // will be different per CF instance

export const giraffeqlOptions = {
debug: !!isDev,
lookupValue: true,
Expand All @@ -19,6 +21,7 @@ export const pgProductionOptions = {
password: env.pg.password,
database: env.pg.database,
...(env.pg.port && { port: env.pg.port }),
application_name: `instance ${now})`,
},
pool: { min: 0, max: 1 },
};
Expand All @@ -32,6 +35,7 @@ export const pgDevOptions = env.pg_dev
password: env.pg_dev.password,
database: env.pg_dev.database,
...(env.pg_dev.port && { port: env.pg_dev.port }),
application_name: `instance ${now})`,
},
pool: { min: 0, max: 1 },
}
Expand Down

0 comments on commit eb954c4

Please sign in to comment.