Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ldn-inbox-server

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ldn-inbox-server - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

2

bin/ldn-inbox-server.js

@@ -20,3 +20,3 @@ #!/usr/bin/env node

.name('lnd-inbox-server')
.version('1.1.3')
.version('1.1.4')
.description('A demonstration Event Notifications Inbox server');

@@ -23,0 +23,0 @@

@@ -7,3 +7,3 @@ const fs = require('fs');

logger.info(`parsing notification ${path}`);
throw Error('eeee');
try {

@@ -10,0 +10,0 @@ const json = JSON.parse(fs.readFileSync(path, { encoding: 'utf-8'}));

@@ -20,29 +20,35 @@ const fs = require('fs');

fs.readdir(path, (err,files) => {
files.forEach( (file) => {
const fullPath = `${path}/${file}`;
if (file.match(glob)) {
// Process
lockfile.lock(fullPath)
.then( async (release) => {
try {
await handler(fullPath,options);
}
catch (e) {
logger.error(e);
logger.error(`handler failed on ${fullPath}`);
}
return release();
})
.catch( (e) => {
// Need some more elegant code here to select of batch of files to
// process in the path. The code below will work as long as the
// number of files in the inbox don't become gigantic...
const files = fs.readdirSync(path);
for (let i = 0 ; i < files.length ; i++) {
const file = files[i];
const fullPath = `${path}/${file}`;
if (file.match(glob)) {
// Process
lockfile.lock(fullPath)
.then( async (release) => {
try {
await handler(fullPath,options);
}
catch (e) {
logger.error(e);
logger.warn(`${fullPath} is locked`);
})
.finally( () => {
logger.error(`handler failed on ${fullPath}`);
}
return release();
})
.catch( (e) => {
logger.debug(`${fullPath} is locked`);
})
.finally( () => {
if (fs.existsSync(fullPath)) {
logger.debug(`removing ${fullPath}`);
fs.unlinkSync(fullPath);
});
}
});
});
}
});
}
}
}

@@ -49,0 +55,0 @@

{
"name": "ldn-inbox-server",
"version": "1.1.3",
"version": "1.1.4",
"description": "A demonstration Event Notifications Inbox server",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc