Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
matrix-media-repo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
matrix-media-repo
Commits
7f63517d
Commit
7f63517d
authored
4 years ago
by
Travis Ralston
Browse files
Options
Downloads
Patches
Plain Diff
Don't estimate datastore size when there's only one datastore
parent
788be302
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
storage/datastore/datastore.go
+7
-4
7 additions, 4 deletions
storage/datastore/datastore.go
with
8 additions
and
4 deletions
CHANGELOG.md
+
1
−
0
View file @
7f63517d
...
@@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
...
@@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
*
GIFs now thumbnail correctly. Thanks @Sorunome!
*
GIFs now thumbnail correctly. Thanks @Sorunome!
*
Fixed empty Content-Type header on retrieved remote media. Thanks @silkeh!
*
Fixed empty Content-Type header on retrieved remote media. Thanks @silkeh!
*
Fixed various issues with IPv6 handling. Thanks @silkeh!
*
Fixed various issues with IPv6 handling. Thanks @silkeh!
*
Fixed high database usage for uploads when only one datastore is present.
## [1.1.3] - July 15th, 2020
## [1.1.3] - July 15th, 2020
...
...
This diff is collapsed.
Click to expand it.
storage/datastore/datastore.go
+
7
−
4
View file @
7f63517d
...
@@ -94,7 +94,6 @@ func GetUriForDatastore(dsConf config.DatastoreConfig) string {
...
@@ -94,7 +94,6 @@ func GetUriForDatastore(dsConf config.DatastoreConfig) string {
}
}
func
PickDatastore
(
forKind
string
,
ctx
rcontext
.
RequestContext
)
(
*
DatastoreRef
,
error
)
{
func
PickDatastore
(
forKind
string
,
ctx
rcontext
.
RequestContext
)
(
*
DatastoreRef
,
error
)
{
// If we haven't found a legacy option, pick a datastore
ctx
.
Log
.
Info
(
"Finding a suitable datastore to pick for "
+
forKind
)
ctx
.
Log
.
Info
(
"Finding a suitable datastore to pick for "
+
forKind
)
confDatastores
:=
ctx
.
Config
.
DataStores
confDatastores
:=
ctx
.
Config
.
DataStores
mediaStore
:=
storage
.
GetDatabase
()
.
GetMediaStore
(
ctx
)
mediaStore
:=
storage
.
GetDatabase
()
.
GetMediaStore
(
ctx
)
...
@@ -122,9 +121,13 @@ func PickDatastore(forKind string, ctx rcontext.RequestContext) (*DatastoreRef,
...
@@ -122,9 +121,13 @@ func PickDatastore(forKind string, ctx rcontext.RequestContext) (*DatastoreRef,
continue
continue
}
}
size
,
err
:=
estimatedDatastoreSize
(
ds
,
ctx
)
var
size
int64
if
err
!=
nil
{
continue
if
len
(
confDatastores
)
>
1
{
size
,
err
=
estimatedDatastoreSize
(
ds
,
ctx
)
if
err
!=
nil
{
continue
}
}
}
if
targetDs
==
nil
||
size
<
dsSize
{
if
targetDs
==
nil
||
size
<
dsSize
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment