Advertisement
Guest User

Untitled

a guest
Jul 30th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.34 KB | None | 0 0
  1.  def is_update_free_time(bar_index)
  2.     cache_key = "progress_bar_#{self.experiment_id}_#{bar_index}"
  3.  
  4.     bar_last_update = Rails.cache.read(cache_key)
  5.     Rails.logger.debug("Bar last update - #{bar_last_update}")
  6.     Rails.cache.write(cache_key, Time.now, :expires_in => 30) if bar_last_update.nil?
  7.  
  8.     not bar_last_update.nil?
  9.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement