When you say "no solution is found after 120 seconds" do you mean that optimality has not been proved (to within the specified tolerances) after 120 seconds? All solvers have some way of saying that if they are still running after a specified number of seconds, then they should stop and return the best solution found so far. But the details of this option vary between solvers. Options for many solvers are given at
https://dev.ampl.com/solvers/index.html. Or to get more help, reply with a list of solvers that you are planning to use.
Or do you mean something else -- for example that if the solver has not found a feasible solution after 120 seconds, it should stop, but otherwise it should continue until optimality is proved? In general, specialized stopping criteria can be defined only for some solvers, and only by implementing a specialized callback function. So it would be important to know exactly what you want to do, in order to give appropriate advice.