Skip to content

Commit e957d16

Browse files
committed
Revert to int64
1 parent 90def67 commit e957d16

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

coderd/database/dbfake/dbfake.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2424,9 +2424,9 @@ func (q *FakeQuerier) GetTemplateInsightsByInterval(ctx context.Context, arg dat
24242424
templateIDSet map[uuid.UUID]struct{}
24252425
}
24262426

2427-
statsByInterval := []statByInterval{{arg.StartTime, arg.StartTime.Add(arg.Interval), make(map[uuid.UUID]struct{}), make(map[uuid.UUID]struct{})}}
2427+
statsByInterval := []statByInterval{{arg.StartTime, arg.StartTime.Add(time.Duration(arg.Interval)), make(map[uuid.UUID]struct{}), make(map[uuid.UUID]struct{})}}
24282428
for statsByInterval[len(statsByInterval)-1].endTime.Before(arg.EndTime) {
2429-
statsByInterval = append(statsByInterval, statByInterval{statsByInterval[len(statsByInterval)-1].endTime, statsByInterval[len(statsByInterval)-1].endTime.Add(arg.Interval), make(map[uuid.UUID]struct{}), make(map[uuid.UUID]struct{})})
2429+
statsByInterval = append(statsByInterval, statByInterval{statsByInterval[len(statsByInterval)-1].endTime, statsByInterval[len(statsByInterval)-1].endTime.Add(time.Duration(arg.Interval)), make(map[uuid.UUID]struct{}), make(map[uuid.UUID]struct{})})
24302430
}
24312431
if statsByInterval[len(statsByInterval)-1].endTime.After(arg.EndTime) {
24322432
statsByInterval[len(statsByInterval)-1].endTime = arg.EndTime

coderd/database/queries.sql.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/sqlc.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ overrides:
2727
- column: "template_with_users.group_acl"
2828
go_type:
2929
type: "TemplateACL"
30-
- db_type: "pg_catalog.interval"
31-
engine: "postgresql"
32-
go_type:
33-
import: "time"
34-
type: "Duration"
3530
rename:
3631
template: TemplateTable
3732
template_with_user: Template

coderd/insights.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func (api *API) insightsTemplates(rw http.ResponseWriter, r *http.Request) {
207207
StartTime: startTime,
208208
EndTime: endTime,
209209
TemplateIDs: templateIDs,
210-
Interval: 24 * time.Hour,
210+
Interval: int64(24 * time.Hour),
211211
})
212212
if err != nil {
213213
return xerrors.Errorf("get template daily insights: %w", err)

0 commit comments

Comments
 (0)