Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

confused by the heart:metrics:fetch_all task #8

Open
jcarres-mdsol opened this issue Dec 25, 2013 · 1 comment
Open

confused by the heart:metrics:fetch_all task #8

jcarres-mdsol opened this issue Dec 25, 2013 · 1 comment

Comments

@jcarres-mdsol
Copy link

bundle exec rake heart:metrics:fetch_all fromdate=2013-09-01 todate=2013-09-03

When I issue this command I can see new rows are created on heart_metrics but these rows have different data than my previous run which is surprising to me. I would spec the command to be idempotent and always create the same set. In fact I would spec it to overwrite old data when run on the same date range.

I am not sure if it is a problem with the system or simply the docs should explain a little how it works.

@cwabbott
Copy link
Owner

I cannot recreate this on Rails 3.2.13.

fetch_all is idempotent. The method first tries to find an existing record that has the same date and movingaverage of 0. If you have already run any commands to cache moving averages then you might see duplicate records for the same date, but that is normal.

Can you give a sample of the data that appears to be duplicated? (full records)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants