Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 69b21c9

Browse files
committed
Use int64 to hold database size in bytes
Standard "int" isn't big enough for some of our existing databases
1 parent 8aea824 commit 69b21c9

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

common/types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ type DBTreeEntry struct {
251251
LicenceSHA string `json:"licence"`
252252
Name string `json:"name"`
253253
Sha256 string `json:"sha256"`
254-
Size int `json:"size"`
254+
Size int64 `json:"size"`
255255
}
256256

257257
type DBInfo struct {
@@ -280,7 +280,7 @@ type DBInfo struct {
280280
RepoModified time.Time
281281
Releases int
282282
SHA256 string
283-
Size int
283+
Size int64
284284
SourceURL string
285285
Stars int
286286
Tables []string
@@ -425,7 +425,7 @@ type ReleaseEntry struct {
425425
Description string `json:"description"`
426426
ReleaserEmail string `json:"email"`
427427
ReleaserName string `json:"name"`
428-
Size int `json:"size"`
428+
Size int64 `json:"size"`
429429
}
430430

431431
type SQLiteDBinfo struct {

common/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func AddDatabase(r *http.Request, loggedInUser string, dbOwner string, dbFolder
119119
e.Name = dbName
120120
e.Sha256 = sha
121121
e.LastModified = lastModified.UTC()
122-
e.Size = int(numBytes)
122+
e.Size = numBytes
123123
if licenceName == "" || licenceName == "Not specified" {
124124
// No licence was specified by the client, so check if the database is already in the system and
125125
// already has one. If so, we use that.

db4s/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,7 @@ func userDatabaseList(pageName string, userAcc string, user string) (dbList []by
13431343
Public bool `json:"public"`
13441344
RepoModified string `json:"repo_modified"`
13451345
SHA256 string `json:"sha256"`
1346-
Size int `json:"size"`
1346+
Size int64 `json:"size"`
13471347
Type string `json:"type"`
13481348
URL string `json:"url"`
13491349
}

webui/pages.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2810,7 +2810,7 @@ func releasesPage(w http.ResponseWriter, r *http.Request) {
28102810
DescriptionMarkdown string `json:"description_markdown"`
28112811
ReleaserUserName string `json:"releaser_user_name"`
28122812
ReleaserDisplayName string `json:"releaser_display_name"`
2813-
Size int `json:"size"`
2813+
Size int64 `json:"size"`
28142814
}
28152815
var pageData struct {
28162816
Auth0 com.Auth0Set

0 commit comments

Comments
 (0)