minnestar / sessionizer

Conference session management application
http://sessions.minnestar.org
MIT License
29 stars 23 forks source link

Class-level caching of Event.current_event breaks things #79

Open pcantrell opened 9 years ago

pcantrell commented 9 years ago

Event does this:

def self.current_event(opts = {})
  @current_event ||= begin
    ...

...which creates a single Event instance that lives as long as Rails is running. This makes the schedule fail to update when sessions are changed, forcing us to restart the dynos. I’m pretty sure it’s also just totally unsafe to hold an ActiveRecord object across requests.

We should do away with this caching and switch schedule to use memcache (which would also save on the fairly substantial rendering time for that page).

pcantrell commented 9 years ago

(Also, note that first values passed to opts win permanently.)