开发者

Ruby Singleton and Shotgun

开发者 https://www.devze.com 2023-02-16 15:50 出处:网络
Im starting with Ruby and our team leader sends us to learn Sinatra, relo开发者_开发知识库ading the application changes is been done by Shotgun, my problem now is that i have a Singleton entity

Im starting with Ruby and our team leader sends us to learn Sinatra, relo开发者_开发知识库ading the application changes is been done by Shotgun, my problem now is that i have a Singleton entity which i would love to keep states between request, but aparently Shotgun restarts is every request.

Any Help or Explanation on this would be apreciated,

Thanks in advance.


You shouldn't expect anything about your application's state to be saved between requests at all (Shotgun or not) unless it is being saved in session data.


For sessions to persist with Shotgun you need to set the key... Otherwise it is reset with every page load.

enable :sessions
set :session_secret, "yourKey" 
0

精彩评论

暂无评论...
验证码 换一张
取 消