diff --git a/bincio/serve/tasks.py b/bincio/serve/tasks.py index d25e9e5..39ff5dd 100644 --- a/bincio/serve/tasks.py +++ b/bincio/serve/tasks.py @@ -2,6 +2,7 @@ from __future__ import annotations import logging +import os import shutil import subprocess import threading @@ -102,6 +103,7 @@ def _site_rebuild_worker() -> None: "--www-root", _webroot], capture_output=True, text=True, + preexec_fn=lambda: os.nice(19), ) if og.returncode != 0: log.error("site-rebuild: og-images failed (rc=%d):\n%s\n%s", diff --git a/scripts/generate_og_images.py b/scripts/generate_og_images.py index fb80aad..e4f2992 100644 --- a/scripts/generate_og_images.py +++ b/scripts/generate_og_images.py @@ -13,6 +13,7 @@ from __future__ import annotations import argparse import json import sys +import time from pathlib import Path @@ -58,6 +59,7 @@ def generate_all(data_dir: Path, www_root: Path) -> None: out_path.write_bytes(png) generated += 1 u_gen += 1 + time.sleep(0.05) except Exception as exc: errors += 1 u_err += 1