fix(core): update

This commit is contained in:
Philipp Kunz 2022-06-26 11:05:53 +02:00
parent 7df1016854
commit c170d41a05
2 changed files with 8 additions and 1 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smartlog-destination-receiver',
version: '2.0.0',
version: '2.0.1',
description: 'a smartlog destination for smartlog-receiver'
}

View File

@ -18,12 +18,19 @@ export class SmartlogDestinationReceiver implements ILogDestination {
this.options = optionsArg;
}
private errorCounter = 0;
public async handleLog(logPackageArg: ILogPackage) {
const response = await this.webrequest.postJson(this.options.receiverEndpoint, {
requestBody: {
auth: plugins.smarthash.sha256FromStringSync(this.options.passphrase),
logPackage: logPackageArg,
},
}).catch(err => {
if (this.errorCounter % 100 === 0) {
console.error(`There seems to be an error with logging.`);
console.error(`Accumulated ${this.errorCounter} errors so far`)
}
this.errorCounter++;
});
return response.body;
}