Update Deno, update Render deploy file
Fixes #33 Fixes #30 (hopefully, can't replicate)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
FROM denoland/deno:ubuntu-2.1.2
|
FROM denoland/deno:ubuntu-2.1.4
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
|
|||||||
@@ -33,18 +33,37 @@ export default class Database {
|
|||||||
return this.db;
|
return this.db;
|
||||||
}
|
}
|
||||||
|
|
||||||
const postgresClient = new Client({
|
try {
|
||||||
user: POSTGRESQL_USER,
|
const postgresClient = new Client({
|
||||||
password: POSTGRESQL_PASSWORD,
|
user: POSTGRESQL_USER,
|
||||||
database: POSTGRESQL_DBNAME,
|
password: POSTGRESQL_PASSWORD,
|
||||||
hostname: POSTGRESQL_HOST,
|
database: POSTGRESQL_DBNAME,
|
||||||
port: POSTGRESQL_PORT,
|
hostname: POSTGRESQL_HOST,
|
||||||
tls,
|
port: POSTGRESQL_PORT,
|
||||||
});
|
tls,
|
||||||
|
});
|
||||||
|
|
||||||
await postgresClient.connect();
|
await postgresClient.connect();
|
||||||
|
|
||||||
this.db = postgresClient;
|
this.db = postgresClient;
|
||||||
|
} catch (error) {
|
||||||
|
// Try to connect without TLS, if the connection type is socket
|
||||||
|
if ((error as Error).toString().includes('No TLS options are allowed when host type is set to "socket"')) {
|
||||||
|
const postgresClient = new Client({
|
||||||
|
user: POSTGRESQL_USER,
|
||||||
|
password: POSTGRESQL_PASSWORD,
|
||||||
|
database: POSTGRESQL_DBNAME,
|
||||||
|
hostname: POSTGRESQL_HOST,
|
||||||
|
port: POSTGRESQL_PORT,
|
||||||
|
});
|
||||||
|
|
||||||
|
await postgresClient.connect();
|
||||||
|
|
||||||
|
this.db = postgresClient;
|
||||||
|
} else {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async disconnectFromPostgres() {
|
protected async disconnectFromPostgres() {
|
||||||
|
|||||||
@@ -33,4 +33,4 @@ services:
|
|||||||
|
|
||||||
databases:
|
databases:
|
||||||
- name: bewcloud
|
- name: bewcloud
|
||||||
plan: starter
|
plan: basic-256mb
|
||||||
|
|||||||
Reference in New Issue
Block a user