Skip to content

Commit

Permalink
Prevent exceeding file delivery rates greather than 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
heathdutton committed Oct 29, 2019
1 parent 5f94ecc commit 32244f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Model/Schedule.php
Expand Up @@ -161,6 +161,10 @@ public function findOpening($startDay = 0, $endDay = 7, $fileRate = 1, $all = fa

// If we have already built a file in this day and can send more...
if ($fileCount > 0 && $fileRate > 1) {
if ($fileCount >= $fileRate) {
// Already hit limit for the day.
continue;
}
// Push the start time to the next available slot in this day.
$daySeconds = $end->format('U') - $start->format('U');
if ('00:00' === $timeFrom && '23:59' === $timeTill) {
Expand Down

0 comments on commit 32244f4

Please sign in to comment.