Giter Club home page Giter Club logo

forgetsy's Issues

"date" option doesn't work when incrementing

> follows_delta = Forgetsy::Delta.create('user_follows', t: 1.week, replay: true)
=> #<Forgetsy::Delta:0x00563af1c7c838 @name="user_follows", @conn=<Redis::Namespace v1.5.3 with client v3.3.3 for redis://localhost:6379/0/forgetsy>>

> follows_delta.fetch
=> {}

> follows_delta.incr('UserFoo', date: 1.minute.ago)
=> [#<Forgetsy::Set:0x00563af1be0e60 @name="user_follows", @conn=<Redis::Namespace v1.5.3 with client v3.3.3 for redis://localhost:6379/0/forgetsy>>, #<Forgetsy::Set:0x00563af1be0e10 @name="user_follows_2t", @conn=<Redis::Namespace v1.5.3 with client v3.3.3 for redis://localhost:6379/0/forgetsy>>]

> follows_delta.fetch
=> {}

I'm using the master branch's code

Retroactive loading of dataset is broken

For starters, the sample on the main README is broken:

follows_delta = Forgetsy::Delta.fetch('user_follows')
follows_delta.incr('UserFoo', date: 2.weeks.ago)
follows_delta.incr('UserBar', date: 10.days.ago)
follows_delta.incr('UserBar', date: 1.week.ago)
follows_delta.incr('UserFoo', date: 1.day.ago)
follows_delta.incr('UserFoo')

Each of the calls to follows_delta.incr results in a NOOP because Forgetsy::Set.valid_incr_date returns false in each case that date is explicitly included...

puts follows_delta.fetch

{"UserFoo"=>0.9997776321896626}

Set.fetch breaks if set was too large

Hi

We've been using forgetsy for 2 weeks, and is now receiving SystemStackError: stack level too deep when fetching results.

It turns out Forgetsy::Delta.fetch does not pass option[:n] to secondary_set.fetch, and fetch_raw returns large array (approx. 65K) to secondary_set.fetch for Hash[*result.flatten], which is too many arguments (approx. 131K after flatten) for Hash to handle.

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.