use TimeConstrained when calling Solve[] to avoid stuck code generation