fix memory limit

This commit is contained in:
Dominic 2023-11-02 21:33:21 +01:00
parent f4fe73bf5f
commit ca3ab6a788
Signed by: msrd0
GPG key ID: DCC8C247452E98F9
2 changed files with 11 additions and 6 deletions

View file

@ -8,7 +8,7 @@ use crate::{
iotro::{intro, outro},
render::ffmpeg::{Ffmpeg, FfmpegInput},
time::{format_date, Time},
Project, ProjectSourceMetadata, Resolution
Project, ProjectSourceMetadata, Resolution, MEM_LIMIT
};
use anyhow::{bail, Context};
use camino::{Utf8Path as Path, Utf8PathBuf as PathBuf};
@ -21,8 +21,6 @@ use std::{
process::{Command, Stdio}
};
const MEMORY_LIMIT: &str = "2G";
const INTRO_LEN: Time = Time {
seconds: 3,
micros: 0
@ -48,7 +46,7 @@ fn cmd() -> Command {
.arg("-q")
.arg("--expand-environment=no")
.arg("-p")
.arg(format!("MemoryMax={MEMORY_LIMIT}"))
.arg(format!("MemoryMax={}", MEM_LIMIT.read().unwrap()))
.arg("--user");
// we use busybox ash for having a shell that outputs commands with -x
cmd.arg("busybox")