question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Enhancement] Storage folder inside other storage folder is a bad idea

See original GitHub issue

I spent way too much time on this issue today, so this is for everybody doing the same dumb thing I did:

const nodePersist = require("node-persist");
const storage1 = nodePersist.create({ dir: ".node-persist/storage1" });
const storage1b = nodePersist.create({ dir: ".node-persist/storage1/storage1b" });

This will not work.

This will give you an extremely undescriptive error : EISDIR: illegal operation on a directory, read. I understand that this may not be the intended use, and it’s too much effort to make this possible, but a clearer error message, or a more detailed description in the readme would be very helpful, because I read ..., just avoid using the same dir for the storage location. as don't use the same directory multiple times.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
akhourycommented, Sep 27, 2021

hmm… init() is async, can you wait for each to finish at first?

// use this if you don't have top-level await yet in your node version: https://v8.dev/features/top-level-await
(async () => {


  const productStorage = storage.create({ dir: 'cache_products',ttl: true, forgiveParseErrors: true }); 
  await productStorage.init();
  
  const reviewStorage = storage.create({ dir: 'cache_reviews',ttl: true, forgiveParseErrors: true }); 
  await reviewStorage.init(); 
  
  const suppliersStorage = storage.create({ dir: 'cache_suppliers',ttl: true, forgiveParseErrors: true }); 
  await suppliersStorage.init();


  // ... rest of your code here
})();

0reactions
towfiqicommented, Sep 27, 2021

Thank you. That seems to have fixed the issue 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is Other Storage on Mac - Nektony
When checking your Mac's storage usage, you may discover that the 'Other Storage' category is taking up quite a lot of space on...
Read more >
"Other Storage" Taking Up More Than 50% of Hard Drive Space
“Other” storage on Mac is files that don't easily fall into the clearer category labels like “Audio" or “Photos”. The types of "Other"...
Read more >
What Is Other Storage on Mac & How to Delete It - Avast
Removing the wrong files could be detrimental to the overall performance of your device. Remove installation files. If you're looking to save ...
Read more >
What exactly is the 'other' section in your phone's storage ...
WHEN YOU CHECK up your storage space on your phone, tablet, or computer, it's normally broken up into different sections.
Read more >
How to delete Other Storage on Mac - MacPaw
1. From your desktop, press Command-F. 2. To manually find where a majority of apps temporary files live, navigate to ~/Library/Application Support 3....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found