Limit magick's memory resources.

This commit is contained in:
ze0987 2025-04-10 19:31:25 +02:00 committed by GitHub
parent 7cc250180f
commit f9b3f7a4d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,7 +49,7 @@ function M:spot(job) require("file"):spot(job) end
function M.with_env()
local cmd = Command("magick"):env("MAGICK_THREAD_LIMIT", 1)
if rt.tasks.image_alloc > 0 then
cmd = cmd:env("MAGICK_MEMORY_LIMIT", rt.tasks.image_alloc)
cmd = cmd:env("MAGICK_MEMORY_LIMIT", rt.tasks.image_alloc):env("MAGICK_DISK_LIMIT", "1MiB")
end
return cmd
end