Coordinate one-off Compose runners with server

This commit is contained in:
Nick Sweeting 2026-08-17 17:46:50 -07:00
parent d479dbe4d1
commit 8f87b64f09
No known key found for this signature in database
2 changed files with 11 additions and 1 deletions

View File

@ -1579,7 +1579,12 @@ class Process(ModelWithDeleteAfter, models.Model):
"""
cleaned = 0
stale = cls.objects.filter(status=cls.StatusChoices.RUNNING)
# Top-level commands own their lifecycle and may run in another Docker
# PID namespace while sharing this database. Their takeover helpers
# validate and finalize them; local psutil cannot do so safely.
stale = cls.objects.filter(status=cls.StatusChoices.RUNNING).exclude(
process_type__in=(cls.TypeChoices.SERVER, cls.TypeChoices.ADD, cls.TypeChoices.UPDATE),
)
if machine is not None:
stale = stale.filter(machine=machine)

View File

@ -22,6 +22,8 @@ services:
- ./data:/data
# Override abx-dl's nested VOLUME so profiles persist across containers.
- ./data/personas:/data/personas
# Let one-off `docker compose run` commands reuse the server's supervisor.
- tmp:/tmp/archivebox
pids_limit: 2048 # avoids low systemd task caps with Chrome and parallel extractors
environment:
# - ADMIN_USERNAME=admin # creates an admin user on first run with the given user/pass combo
@ -122,3 +124,6 @@ services:
# allow_other: 'true'
# vfs_cache_mode: full
# poll_interval: 0
volumes:
tmp: