Why not update their count in the db once a minute?  If you want, the code
would be simpler to sample all of them once a minute.  It wouldn't be as
accurate but it would work well.

On Mon, Aug 20, 2012 at 5:09 PM, Filipe <[email protected]> wrote:

> Hi everyone!
>
> I have this scenario: Express, Socket.io and MongoDB.
>
> The problem: reward points to the user on how many seconds (or time in
> general) he keeps logged in (with the Socket opened).
>
> This is for a chat site I'm building and I want to build a ranking
> based on how many minutes users stay connected. I've already built all
> the register/login/messages but now I'm in a dead end with this
> problem.
>
> How would you solve this?
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to