Skip to content

Commit 8c229ef

Browse files
authored
fix: hot update following deployment (#395)
1 parent e1c798f commit 8c229ef

6 files changed

Lines changed: 10 additions & 1 deletion

File tree

services/api/src/shared-backend/db.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ async function createPostgresClient(
103103
try {
104104
return postgres(connectionString, {
105105
connect_timeout: 10,
106+
ssl: config.NODE_ENV === "production" ? "require" : undefined,
106107
});
107108
} catch (e) {
108109
log.error(`Unable to connect to the database (${useReadReplica ? 'read replica' : 'primary'})`);

services/math-updater/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ RUN npm install -g pnpm
44
ENV PATH=/app/node_modules/.bin:$PATH
55
COPY package.json ./
66
COPY pnpm-lock.yaml ./
7-
RUN pnpm install
7+
COPY pnpm-workspace-docker.yaml ./pnpm-workspace.yaml
8+
RUN pnpm install --frozen-lockfile
89
COPY . ./
910
RUN pnpm build
1011

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dangerouslyAllowAllBuilds: true

services/math-updater/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,13 @@ async function main() {
115115
ssl: { rejectUnauthorized: false },
116116
};
117117
} else {
118+
const sslConfig = config.NODE_ENV === "production"
119+
? { rejectUnauthorized: false }
120+
: undefined;
118121
pgBossConfig = {
119122
...pgBossCommonConfig,
120123
connectionString: config.CONNECTION_STRING,
124+
ssl: sslConfig,
121125
};
122126
}
123127

services/math-updater/src/shared-backend/db.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ async function createPostgresClient(
103103
try {
104104
return postgres(connectionString, {
105105
connect_timeout: 10,
106+
ssl: config.NODE_ENV === "production" ? "require" : undefined,
106107
});
107108
} catch (e) {
108109
log.error(`Unable to connect to the database (${useReadReplica ? 'read replica' : 'primary'})`);

services/shared-backend/src/db.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ async function createPostgresClient(
102102
try {
103103
return postgres(connectionString, {
104104
connect_timeout: 10,
105+
ssl: config.NODE_ENV === "production" ? "require" : undefined,
105106
});
106107
} catch (e) {
107108
log.error(`Unable to connect to the database (${useReadReplica ? 'read replica' : 'primary'})`);

0 commit comments

Comments
 (0)