distribute scheduled nodes evenly by filling days sequentially

This commit is contained in:
Yisroel Baum 2026-04-23 21:06:22 +03:00
parent 358694e7e3
commit 49663d70d9
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
2 changed files with 52 additions and 1 deletions

View file

@ -82,8 +82,9 @@ class CreatePlan
$currentDate = $currentDate->modify('+1 day');
}
$nodesPerDay = (int) ceil(count($nodesOfText) / count($dates));
foreach ($nodesOfText as $index => $node) {
$dateIndex = $index % count($dates);
$dateIndex = (int) floor($index / $nodesPerDay);
$scheduledDate = $dates[$dateIndex];
$this->createScheduledNode->execute(