Patch handleShutdown feature (#4361)

* Add handleShutdown Test of MongoStorageAdapter.

* Add `handleShutdown` function in PostgresStorageAdapter, with it's test.

* Replace the _pgp to _client

* Use  `adapter._client.$pool.ending` to ckeck is ending

* Add `handleShutdown()` in ParseServer.spec.js

* Trigger

* Set Server to Default
This commit is contained in:
CHANG, TZU-YEN
2017-11-19 04:20:19 +08:00
committed by Florent Vilmart
parent de73f3723c
commit 8bf6abfee3
4 changed files with 79 additions and 0 deletions

View File

@@ -574,6 +574,13 @@ export class PostgresStorageAdapter {
this._pgp = pgp;
}
handleShutdown() {
if (!this._client) {
return
}
this._client.$pool.end();
}
_ensureSchemaCollectionExists(conn) {
conn = conn || this._client;
return conn.none('CREATE TABLE IF NOT EXISTS "_SCHEMA" ( "className" varChar(120), "schema" jsonb, "isParseClass" bool, PRIMARY KEY ("className") )')