Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
96cd3545
Commit
96cd3545
authored
Aug 24, 2019
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename FileReplication as Replication
parent
7ebcc620
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
11 additions
and
11 deletions
+11
-11
ee/app/models/geo/fdw/upload.rb
ee/app/models/geo/fdw/upload.rb
+1
-1
ee/app/models/geo/file_registry.rb
ee/app/models/geo/file_registry.rb
+3
-3
ee/app/models/geo/upload_registry.rb
ee/app/models/geo/upload_registry.rb
+1
-1
ee/app/services/geo/base_file_service.rb
ee/app/services/geo/base_file_service.rb
+1
-1
ee/app/services/geo/file_registry_removal_service.rb
ee/app/services/geo/file_registry_removal_service.rb
+1
-1
ee/app/workers/geo/file_download_dispatch_worker.rb
ee/app/workers/geo/file_download_dispatch_worker.rb
+1
-1
ee/app/workers/geo/migrated_local_files_clean_up_worker.rb
ee/app/workers/geo/migrated_local_files_clean_up_worker.rb
+1
-1
ee/lib/gitlab/geo/replication.rb
ee/lib/gitlab/geo/replication.rb
+2
-2
No files found.
ee/app/models/geo/fdw/upload.rb
View file @
96cd3545
...
...
@@ -49,7 +49,7 @@ module Geo
join_statement
=
arel_table
.
join
(
file_registry_table
,
Arel
::
Nodes
::
OuterJoin
)
.
on
(
arel_table
[
:id
].
eq
(
file_registry_table
[
:file_id
]).
and
(
file_registry_table
[
:file_type
].
in
(
Gitlab
::
Geo
::
File
Replication
::
USER_UPLOADS_OBJECT_TYPES
)))
.
on
(
arel_table
[
:id
].
eq
(
file_registry_table
[
:file_id
]).
and
(
file_registry_table
[
:file_type
].
in
(
Gitlab
::
Geo
::
Replication
::
USER_UPLOADS_OBJECT_TYPES
)))
joins
(
join_statement
.
join_sources
)
end
...
...
ee/app/models/geo/file_registry.rb
View file @
96cd3545
...
...
@@ -3,19 +3,19 @@
class
Geo::FileRegistry
<
Geo
::
BaseRegistry
include
Geo
::
Syncable
scope
:attachments
,
->
{
where
(
file_type:
Gitlab
::
Geo
::
File
Replication
::
USER_UPLOADS_OBJECT_TYPES
)
}
scope
:attachments
,
->
{
where
(
file_type:
Gitlab
::
Geo
::
Replication
::
USER_UPLOADS_OBJECT_TYPES
)
}
scope
:failed
,
->
{
where
(
success:
false
).
where
.
not
(
retry_count:
nil
)
}
scope
:fresh
,
->
{
order
(
created_at: :desc
)
}
scope
:lfs_objects
,
->
{
where
(
file_type: :lfs
)
}
scope
:never
,
->
{
where
(
success:
false
,
retry_count:
nil
)
}
scope
:uploads
,
->
{
where
(
file_type:
Gitlab
::
Geo
::
File
Replication
::
UPLOAD_OBJECT_TYPE
)
}
scope
:uploads
,
->
{
where
(
file_type:
Gitlab
::
Geo
::
Replication
::
UPLOAD_OBJECT_TYPE
)
}
self
.
inheritance_column
=
'file_type'
def
self
.
find_sti_class
(
file_type
)
if
file_type
==
'lfs'
Geo
::
LfsObjectRegistry
elsif
Gitlab
::
Geo
::
File
Replication
.
object_type_from_user_uploads?
(
file_type
)
elsif
Gitlab
::
Geo
::
Replication
.
object_type_from_user_uploads?
(
file_type
)
Geo
::
UploadRegistry
end
end
...
...
ee/app/models/geo/upload_registry.rb
View file @
96cd3545
...
...
@@ -10,7 +10,7 @@ class Geo::UploadRegistry < Geo::FileRegistry
def
self
.
type_condition
(
table
=
arel_table
)
sti_column
=
arel_attribute
(
inheritance_column
,
table
)
sti_names
=
Gitlab
::
Geo
::
File
Replication
::
USER_UPLOADS_OBJECT_TYPES
sti_names
=
Gitlab
::
Geo
::
Replication
::
USER_UPLOADS_OBJECT_TYPES
sti_column
.
in
(
sti_names
)
end
...
...
ee/app/services/geo/base_file_service.rb
View file @
96cd3545
...
...
@@ -25,7 +25,7 @@ module Geo
private
def
user_upload?
Gitlab
::
Geo
::
File
Replication
.
object_type_from_user_uploads?
(
object_type
)
Gitlab
::
Geo
::
Replication
.
object_type_from_user_uploads?
(
object_type
)
end
def
job_artifact?
...
...
ee/app/services/geo/file_registry_removal_service.rb
View file @
96cd3545
...
...
@@ -78,7 +78,7 @@ module Geo
LfsObject
.
find
(
object_db_id
).
file
when
:job_artifact
Ci
::
JobArtifact
.
find
(
object_db_id
).
file
when
*
Gitlab
::
Geo
::
File
Replication
::
USER_UPLOADS_OBJECT_TYPES
when
*
Gitlab
::
Geo
::
Replication
::
USER_UPLOADS_OBJECT_TYPES
Upload
.
find
(
object_db_id
).
build_uploader
else
raise
NameError
,
"Unrecognized type:
#{
object_type
}
"
...
...
ee/app/workers/geo/file_download_dispatch_worker.rb
View file @
96cd3545
...
...
@@ -66,7 +66,7 @@ module Geo
def
job_finders
@job_finders
||=
[
Geo
::
FileDownloadDispatchWorker
::
AttachmentJobFinder
.
new
(
scheduled_file_ids
(
Gitlab
::
Geo
::
File
Replication
::
USER_UPLOADS_OBJECT_TYPES
)),
Geo
::
FileDownloadDispatchWorker
::
AttachmentJobFinder
.
new
(
scheduled_file_ids
(
Gitlab
::
Geo
::
Replication
::
USER_UPLOADS_OBJECT_TYPES
)),
Geo
::
FileDownloadDispatchWorker
::
LfsObjectJobFinder
.
new
(
scheduled_file_ids
(
:lfs
)),
Geo
::
FileDownloadDispatchWorker
::
JobArtifactJobFinder
.
new
(
scheduled_file_ids
(
:job_artifact
))
]
...
...
ee/app/workers/geo/migrated_local_files_clean_up_worker.rb
View file @
96cd3545
...
...
@@ -58,7 +58,7 @@ module Geo
def
find_migrated_local_attachments_ids
(
batch_size
:)
return
[]
unless
attachments_object_store_enabled?
attachments_finder
.
find_migrated_local
(
batch_size:
batch_size
,
except_file_ids:
scheduled_file_ids
(
Gitlab
::
Geo
::
File
Replication
::
USER_UPLOADS_OBJECT_TYPES
))
attachments_finder
.
find_migrated_local
(
batch_size:
batch_size
,
except_file_ids:
scheduled_file_ids
(
Gitlab
::
Geo
::
Replication
::
USER_UPLOADS_OBJECT_TYPES
))
.
pluck
(
:uploader
,
:id
)
.
map
{
|
uploader
,
id
|
[
uploader
.
sub
(
/Uploader\z/
,
''
).
underscore
,
id
]
}
end
...
...
ee/lib/gitlab/geo/
file_
replication.rb
→
ee/lib/gitlab/geo/replication.rb
View file @
96cd3545
...
...
@@ -2,11 +2,11 @@
module
Gitlab
module
Geo
module
File
Replication
module
Replication
USER_UPLOADS_OBJECT_TYPES
=
%i[attachment avatar file import_export namespace_file personal_file favicon]
.
freeze
UPLOAD_OBJECT_TYPE
=
:file
def
object_type_from_user_uploads?
(
object_type
)
def
self
.
object_type_from_user_uploads?
(
object_type
)
USER_UPLOADS_OBJECT_TYPES
.
include?
(
object_type
.
to_sym
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment