Skip to content

increment hits instead of adding new row #24

Description

@Rubioli

punching_bag gem is a great. But when it comes to performance I have some worries since its adds a new row for each hit.

I was wondering if its possible to increment by 1 if punchable_id exists already otherwise add a new row. This will help performance much.

I know I can do rake punching_bag:combine but then I need to to crone jobs etc and at the same time when I run rake punching_bag:combine if some posts are removed, its aborting the task since it can't find them. This is the errors:

rake aborted!
ActiveRecord::RecordNotFound: Couldn't find all Posts with 'id': (1,3,5,7,8,9)

Is it any way I can change/where can I change the gem to increment and not always add a new line?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions