On Tue, Aug 4, 2009 at 9:39 AM, Frederick
Cheung<[email protected]> wrote:

>> Web site sells unique/limited quantity items.
>> User puts item in cart; item is now unavailable to other users.
>> User abandons cart (stops interacting with site for 30 minutes)
>> Cart is "emptied", item is returned to inventory.
>
> Well presumably in your case you have to track the fact that this item
> is now locked or whatever in the database. Make it so that such locks
> are updated while the user keeps using the site and have a cronjob
> that expires locks from users that have not been active since X.

Yeah, it's the cronjob aspect that seems extremely clunky to me,
but that could be a background task.

> Another possibility is to have a locked_until field, in which case you
> don't need to clear out the lock at all.

Ah, interesting approach. Since that would have to be updated on
each subsequent request by that user, what would be the DRYest
way to trigger the update?

-- 
Hassan Schroeder ------------------------ [email protected]
twitter: @hassan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to