diff --git a/spec/unit/features/cost_budget.feature b/spec/unit/features/cost_budget.feature index 50c66a6..c63bfb2 100644 --- a/spec/unit/features/cost_budget.feature +++ b/spec/unit/features/cost_budget.feature @@ -117,7 +117,7 @@ Feature: Cost budget limiter module behavior Scenario: computes weekly period boundary aligned to Monday UTC When I compute period start for period "7d" at now 1770129000 - Then the period start is 1769904000 + Then the period start is 1769990400 Scenario: rejects unknown period in period start computation When I compute period start for period "30m" at now 1770129000 diff --git a/src/fairvisor/cost_budget.lua b/src/fairvisor/cost_budget.lua index fc85f26..570f5d4 100644 --- a/src/fairvisor/cost_budget.lua +++ b/src/fairvisor/cost_budget.lua @@ -92,7 +92,7 @@ function _M.compute_period_start(period, now) end if period == "7d" then - return floor((now - 259200) / 604800) * 604800 + 259200 + return floor((now - 345600) / 604800) * 604800 + 345600 end return nil, "unknown period"