feat: add TTLCache for get_cache_version and TEMPLATE_AUTO_RELOAD config with Makefile worker count variables

This commit is contained in:
2026-06-14 14:46:36 +00:00
parent c151325916
commit d75d5dc6a8
149 changed files with 9811 additions and 262 deletions
@@ -1,10 +1,11 @@
# retoor <retoor@molodetz.nl>
import asyncio
import json
import tempfile
from pathlib import Path
from tests.conftest import run_async
from devplacepy.services.jobs.deepsearch import crawl as crawl_module
from devplacepy.services.jobs.deepsearch import worker as worker_module
from devplacepy.services.jobs.deepsearch.crawl import CrawledPage, CrawlOutcome
@@ -79,7 +80,7 @@ def test_worker_run_produces_report(monkeypatch):
"collection": "ds_worker_test_one",
"cached_hashes": [],
}
report = asyncio.run(worker_module._run(payload, output_dir))
report = run_async(worker_module._run(payload, output_dir))
assert report["query"] == "history of the transistor"
assert report["page_count"] == 2
assert report["chunk_count"] > 0
@@ -100,4 +101,4 @@ def test_worker_control_cancel_stops(monkeypatch):
output_dir = Path(tmp)
(output_dir / "control.json").write_text(json.dumps({"state": "cancelled"}))
should_stop = worker_module._make_stop(output_dir)
assert asyncio.run(should_stop()) is True
assert run_async(should_stop()) is True
+2
View File
@@ -52,6 +52,8 @@ def _make_source_project(*, is_private=False, binary=False):
)
get_table("projects").insert(
{
"deleted_at": None,
"deleted_by": None,
"uid": pid,
"user_uid": owner_uid,
"slug": f"{pid}-source",
+4
View File
@@ -240,6 +240,8 @@ def test_export_blocks_malicious_db_path(zip_env, tmp_path):
pid = "ziptest-evil"
get_table("project_files").insert(
{
"deleted_at": None,
"deleted_by": None,
"uid": "evil-node",
"project_uid": pid,
"user_uid": "u",
@@ -267,6 +269,8 @@ def test_traversal_payload_marks_job_failed(zip_env):
pid = "ziptest-evil2"
get_table("project_files").insert(
{
"deleted_at": None,
"deleted_by": None,
"uid": "evil-node2",
"project_uid": pid,
"user_uid": "u",