satellite/satellitedb: fix ProjectAccounting project bandwidth calculation

Period end was calculated
incorrectly as it was still in current month but
should be the first day of next month.

Change-Id: I37451d29a9b901b69e6c3c401b333c58b3376d61
This commit is contained in:
Michał Niewrzał 2021-06-30 14:54:12 +02:00
parent 1c3688f1d6
commit aa7fd8c9cd

View File

@ -150,7 +150,7 @@ func (db *ProjectAccounting) GetProjectBandwidth(ctx context.Context, projectID
} else {
expiredSince = time.Date(year, month, day-allocatedExpirationInDays, 0, 0, 0, 0, time.UTC)
}
periodEnd := time.Date(year, month+1, 0, 0, 0, 0, 0, time.UTC)
periodEnd := time.Date(year, month+1, 1, 0, 0, 0, 0, time.UTC)
query := `WITH egress AS (
SELECT