mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-09-14 11:06:13 +05:00
Persist derived config unsets
This commit is contained in:
parent
7528d1f68d
commit
abdede3609
@ -29,6 +29,10 @@ class MachineService(BaseService):
|
||||
key = event.key.replace("config/", "", 1).strip()
|
||||
if key:
|
||||
config[key] = event.value
|
||||
elif event.method == "unset":
|
||||
key = event.key.replace("config/", "", 1).strip()
|
||||
if key:
|
||||
config.pop(key, None)
|
||||
else:
|
||||
return
|
||||
|
||||
|
||||
@ -466,6 +466,15 @@ def test_machine_service_persists_only_derived_config_events(tmp_path):
|
||||
)
|
||||
await derived_event.now()
|
||||
await derived_event.event_results_list()
|
||||
unset_event = bus.emit(
|
||||
MachineEvent(
|
||||
method="unset",
|
||||
key="config/WGET_BINARY",
|
||||
config_type="derived",
|
||||
),
|
||||
)
|
||||
await unset_event.now()
|
||||
await unset_event.event_results_list()
|
||||
await bus.wait_until_idle()
|
||||
finally:
|
||||
await bus.destroy()
|
||||
@ -474,7 +483,6 @@ def test_machine_service_persists_only_derived_config_events(tmp_path):
|
||||
|
||||
machine.refresh_from_db()
|
||||
assert machine.config == {
|
||||
"WGET_BINARY": str(wget_binary),
|
||||
"ABX_INSTALL_CACHE": {"wget": "2026-03-24T00:00:00+00:00"},
|
||||
}
|
||||
|
||||
|
||||
@ -80,8 +80,8 @@ dependencies = [
|
||||
### Binary/Package Management
|
||||
"abxbus>=2.5.4", # EventBus API
|
||||
"abxpkg>=1.10.7", # for: detecting, versioning, and installing binaries via apt/brew/pip/npm
|
||||
"abx-plugins>=1.10.69", # shared ArchiveBox plugin package with Chrome/Puppeteer dependency wiring
|
||||
"abx-dl>=1.10.69", # shared ArchiveBox downloader package with blocking install preflight
|
||||
"abx-plugins>=1.10.70", # shared ArchiveBox plugin package with Chrome/Puppeteer dependency wiring
|
||||
"abx-dl>=1.10.70", # shared ArchiveBox downloader package with blocking install preflight
|
||||
### UUID7 backport for Python <3.14
|
||||
"uuid7>=0.1.0; python_version < '3.14'", # provides the uuid_extensions module on Python 3.13
|
||||
]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user