Browse Source

fix(elasticsearch-plugin): Close down es client when app closes

Michael Bromley 6 years ago
parent
commit
44809a1dd6
1 changed files with 5 additions and 0 deletions
  1. 5 0
      packages/elasticsearch-plugin/src/plugin.ts

+ 5 - 0
packages/elasticsearch-plugin/src/plugin.ts

@@ -132,6 +132,11 @@ export class ElasticsearchPlugin implements VendurePlugin {
         });
     }
 
+    /** @internal */
+    onClose() {
+        return this.client.close();
+    }
+
     /** @internal */
     extendAdminAPI(): APIExtensionDefinition {
         return {