fix(core): update
This commit is contained in:
parent
7df1016854
commit
c170d41a05
@ -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'
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user