mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
reduce --th-ram-max
floor;
helps avoid oom in a vm with 512 MiB ram
This commit is contained in:
parent
ad200f2b97
commit
dc3b7a2720
|
@ -1352,7 +1352,7 @@ def add_admin(ap):
|
|||
|
||||
def add_thumbnail(ap):
|
||||
th_ram = (RAM_AVAIL or RAM_TOTAL or 9) * 0.6
|
||||
th_ram = int(max(min(th_ram, 6), 1) * 10) / 10
|
||||
th_ram = int(max(min(th_ram, 6), 0.3) * 10) / 10
|
||||
ap2 = ap.add_argument_group('thumbnail options')
|
||||
ap2.add_argument("--no-thumb", action="store_true", help="disable all thumbnails (volflag=dthumb)")
|
||||
ap2.add_argument("--no-vthumb", action="store_true", help="disable video thumbnails (volflag=dvthumb)")
|
||||
|
|
|
@ -472,6 +472,8 @@ FN_EMB = set([".prologue.html", ".epilogue.html", "readme.md", "preadme.md"])
|
|||
|
||||
|
||||
def read_ram() -> tuple[float, float]:
|
||||
# NOTE: apparently no need to consider /sys/fs/cgroup/memory.max
|
||||
# (cgroups2) since the limit is synced to /proc/meminfo
|
||||
a = b = 0
|
||||
try:
|
||||
with open("/proc/meminfo", "rb", 0x10000) as f:
|
||||
|
|
Loading…
Reference in a new issue