GithubHelp home page GithubHelp logo

Store is not persisting about data-store HOT 6 CLOSED

plopez01 avatar plopez01 commented on July 2, 2024
Store is not persisting

from data-store.

Comments (6)

plopez01 avatar plopez01 commented on July 2, 2024 1

Oh, thanks a lot, im going to do it with gists. Thanks @jonschlinkert and @doowb

from data-store.

jonschlinkert avatar jonschlinkert commented on July 2, 2024

Hmm, let's try to figure out what's happening.

A few questions:

  1. Can you share a snippet of code to show your configuration for the Store? It would be useful to see how the options are passed, including the store name, cwd/path etc.
  2. Can show an example or describe more about how you're using the actual API? It would help to know, for example, if the Store API is being used directly, or if another class inheriting Store, etc. This will help us rule out prototype pollution or similar causes.
  3. Can you share the version of node that is being used? OS? Or any other info about the environment that might help.
  4. It sounds like there isn't anything specific that is telling you what might be happening. Do you have any "hunches" or thoughts about what what's causing the bug? Anything at all that might help get us thinking?

Fwiw, I have a complete refactor of this ready to push up, I started working on it a while ago. It's possible that it will solve whatever issue you're having, simply because it's simpler and has fewer dependencies, making it easier to debug and use.

However, it has a few breaking changes. I'll try to list them here in a bit, but I want to create this reply so you have a change to respond first.

Thanks for brining this to our attention! It's greatly appreciated!

from data-store.

plopez01 avatar plopez01 commented on July 2, 2024

Thanks for responding that fast!

This is my store declaration:
var store = require('data-store')('abc', { cwd: './store' });
Im using node 8.11.1
Os, hmm i don't know, my bot is hosted by heroku and i deploy it using GIT.

I have this: When i start bot, the values are registred in the database, but, when i restart the bot, the values disappear, maybe git is preventing to create the store file, and is deleting it, or maybe something is resseting the store file.

from data-store.

doowb avatar doowb commented on July 2, 2024

@plopez01 I don't think heroku persists files across restarts so the file is probably being deleted then. You would need to save the file someplace else before the bot shuts down and restore it when the bot starts up. You could do this with S3 or even use gists to keep a secret gist of the file.

from data-store.

jonschlinkert avatar jonschlinkert commented on July 2, 2024

Ah, that's it! I guess this is good news, and bad news. I didn't pay enough attention to the Heroku comment. AFAIK, heroku still does not allow data to be persisted like that. It will be deleted every time you git push. I'm not sure what the best solution would be for you, since I know very little about your use case and lots of other important factors, but now that we know what the likely cause is, I'm pretty sure there is a bunch of info on the heroku docs, stackoverflow, google about what's happening and other options.

from data-store.

jonschlinkert avatar jonschlinkert commented on July 2, 2024

ha I didn't see @doowb's comment until I saved my last one! The page didn't refresh! Looks like I was a little late on that one! lol

from data-store.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.