Skip to content

Commit

Permalink
[API] Fix should run with memray test [1.6.x] (#5611)
Browse files Browse the repository at this point in the history
  • Loading branch information
alonmr committed May 22, 2024
1 parent 7890352 commit cbae1d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/api/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import distutils.util
import pathlib
from os import environ, path
from subprocess import Popen
Expand Down Expand Up @@ -96,7 +97,8 @@ def db(
p.mkdir(parents=True, exist_ok=True)

cmd = [executable, "-m", "server.api.main"]
if env.get("MLRUN_MEMRAY") != "0":
run_with_memray = distutils.util.strtobool(env.get("MLRUN_MEMRAY", "false"))
if run_with_memray:
cmd = [executable, "-m", "memray", "run"]
output_file = env.get("MLRUN_MEMRAY_OUTPUT_FILE", None)
if output_file:
Expand Down

0 comments on commit cbae1d9

Please sign in to comment.