Git Product home page Git Product logo

Comments (4)

tidwall avatar tidwall commented on July 17, 2024 1

I just added a feature that will compare the ttl against the database mod time at load.

if noKeyTTL || (keyTTL-time.Now().Sub(dbLastModTime) > 0) {
    ... load the key into the database ...
}

I think that this will suffice for the majority of cases.
Let me know if this works for you.

from buntdb.

tidwall avatar tidwall commented on July 17, 2024

Yes, this is by design. It's not ideal and I've debated using a timestamp rather than a TTL duration, but ran into other issues with the timestamp. So I ended up settling on using a duration, which mimics the functionality of Redis's TTLs. And Redis also suffers from the same issue.

I have an idea though. I think I'll explore it and get back to you shortly.

from buntdb.

imikod avatar imikod commented on July 17, 2024

Yes thank you that works for me!
For redis or redcon it isn't a big deal but for embedded use it's somewhat different.

from buntdb.

tidwall avatar tidwall commented on July 17, 2024

Great to hear. Thanks a ton for your help.

from buntdb.

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.