feat: use image concurrency for outfit directories

This commit is contained in:
2026-06-22 18:10:54 +08:00
parent 00ed41db14
commit e83dd07dc0
7 changed files with 131 additions and 45 deletions
+5 -2
View File
@@ -91,15 +91,17 @@ class TestOutfitBatchRunner(unittest.TestCase):
self.assertEqual(summary.success_count, 1)
self.assertEqual(summary.results[0].attempts, 2)
def test_concurrency_runs_more_than_one_task_at_once(self):
def test_concurrency_option_does_not_parallelize_excel_rows(self):
from core.outfit_batch import OutfitBatchOptions, OutfitBatchRunner
active = [0]
max_active = [0]
started = []
lock = threading.Lock()
def generate(task):
with lock:
started.append(task.row_index)
active[0] += 1
max_active[0] = max(max_active[0], active[0])
time.sleep(0.05)
@@ -116,7 +118,8 @@ class TestOutfitBatchRunner(unittest.TestCase):
summary = runner.run()
self.assertEqual(summary.success_count, 4)
self.assertGreaterEqual(max_active[0], 2)
self.assertEqual(max_active[0], 1)
self.assertEqual(started, [2, 3, 4, 5])
def test_task_cooldown_is_applied(self):
from core.outfit_batch import OutfitBatchOptions, OutfitBatchRunner