I have a method in controller that calls another method created in a module like this example:
def example
@var1 = ModuleName::ClassName.get()
respond_to do |format|
format.json { render json: @var1}
end
end
The method get() goes to a website looking for information and returns an array.
Everything works perfectly, but I wonder if in the controller there is a way to set a timeout if the application takes a long time to run! Is it possible?
here is one way (a more general way) you could do that..