class ZuoraConnect::AppInstanceBase
def cache_app_instance
def cache_app_instance if defined?(Redis.current) #Task data must be present and the last refresh cannot be old. We dont want to overwite new cache data with old if self.task_data.present? && (self.last_refresh.to_i > INSTANCE_REFRESH_WINDOW.ago.to_i) ZuoraConnect.logger.debug("Caching AppInstance", self.default_ougai_items) Redis.current.setex("AppInstance:#{self.id}", INSTANCE_REDIS_CACHE_PERIOD.to_i, self.encrypt_data(data: self.save_data)) end end end