LSWS Rails App MySQL Connection Errors

mistwang

LiteSpeed Staff
#21
Rails developers keep changing the API, I do not know exactly which function to use. :(

ActiveRecord::Base.clear_all_connections! is a delegation to
ActiveRecord::Base.connection_handler.clear_all_connections!
 
#22
Rails developers keep changing the API, I do not know exactly which function to use. :(

ActiveRecord::Base.clear_all_connections! is a delegation to
ActiveRecord::Base.connection_handler.clear_all_connections!
you can allways check if activerecord respond_to :)

ActiveRecord::Base.clear_all_connections! if ActiveRecord::Base.respond_to?:)clear_all_connections!)

:)
 

mistwang

LiteSpeed Staff
#23
Thanks for the tip.

The problem is that we need to keep the script compatible with all Rails versions. One API function may appear/disappear from version to version. It may work for one version, then stopped for next. Very hard to maintain.
 
#24
Thanks for the tip.

The problem is that we need to keep the script compatible with all Rails versions. One API function may appear/disappear from version to version. It may work for one version, then stopped for next. Very hard to maintain.
i know that :) by the way litespeed supports multithread for rails (not fork)?
 

mistwang

LiteSpeed Staff
#25
No, prefork only.
LSAPI itself can work with multi-thread, but it is not widely used/tested.
Ruby support true multi-thread now? not just software simulated fake multi-thread?
 
Top