fix(core): update

This commit is contained in:
Philipp Kunz 2019-01-12 21:06:29 +01:00
parent 54fe89860e
commit 5546fa5f49
2 changed files with 9 additions and 2 deletions

View File

@ -30,4 +30,8 @@ tap.test('should create a valid instance of SmartAcme', async () => {
// await smartAcmeInstance.getCertificateForDomain('bleu.de'); // await smartAcmeInstance.getCertificateForDomain('bleu.de');
}); });
tap.test('should stop correctly', async () => {
await smartAcmeInstance.stop();
});
tap.start(); tap.start();

View File

@ -1,4 +1,5 @@
import * as plugins from './smartacme.plugins'; import * as plugins from './smartacme.plugins';
import { Cert } from './smartacme.classes.cert';
import { CertManager } from './smartacme.classes.certmanager'; import { CertManager } from './smartacme.classes.certmanager';
import * as interfaces from './interfaces'; import * as interfaces from './interfaces';
@ -112,9 +113,11 @@ export class SmartAcme {
}); });
} }
public async stop() {}; public async stop() {
await this.certmanager.smartdataDb.close();
}
public async getCertificateForDomain(domainArg: string) { public async getCertificateForDomain(domainArg: string): Promise<Cert> {
const domain = domainArg; const domain = domainArg;
const retrievedCertificate = await this.certmanager.retrieveCertificate(domain); const retrievedCertificate = await this.certmanager.retrieveCertificate(domain);