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
e6a64aac
Commit
e6a64aac
authored
May 01, 2018
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace `with_files_stored_locally` with `geo_syncable`
parent
e5fc2b1e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
18 additions
and
9 deletions
+18
-9
ee/app/finders/geo/attachment_registry_finder.rb
ee/app/finders/geo/attachment_registry_finder.rb
+3
-3
ee/app/finders/geo/job_artifact_registry_finder.rb
ee/app/finders/geo/job_artifact_registry_finder.rb
+3
-3
ee/app/finders/geo/lfs_object_registry_finder.rb
ee/app/finders/geo/lfs_object_registry_finder.rb
+3
-3
ee/app/models/ee/ci/job_artifact.rb
ee/app/models/ee/ci/job_artifact.rb
+2
-0
ee/app/models/ee/lfs_object.rb
ee/app/models/ee/lfs_object.rb
+2
-0
ee/app/models/ee/upload.rb
ee/app/models/ee/upload.rb
+2
-0
ee/app/models/geo/fdw/ci/job_artifact.rb
ee/app/models/geo/fdw/ci/job_artifact.rb
+1
-0
ee/app/models/geo/fdw/lfs_object.rb
ee/app/models/geo/fdw/lfs_object.rb
+1
-0
ee/app/models/geo/fdw/upload.rb
ee/app/models/geo/fdw/upload.rb
+1
-0
No files found.
ee/app/finders/geo/attachment_registry_finder.rb
View file @
e6a64aac
...
@@ -9,7 +9,7 @@ module Geo
...
@@ -9,7 +9,7 @@ module Geo
end
end
def
local_attachments
def
local_attachments
attachments
.
with_files_stored_locally
attachments
.
geo_syncable
end
end
def
count_local_attachments
def
count_local_attachments
...
@@ -161,7 +161,7 @@ module Geo
...
@@ -161,7 +161,7 @@ module Geo
def
fdw_find_local_attachments
def
fdw_find_local_attachments
fdw_attachments
.
joins
(
"INNER JOIN file_registry ON file_registry.file_id =
#{
fdw_attachments_table
}
.id"
)
fdw_attachments
.
joins
(
"INNER JOIN file_registry ON file_registry.file_id =
#{
fdw_attachments_table
}
.id"
)
.
with_files_stored_locally
.
geo_syncable
.
merge
(
Geo
::
FileRegistry
.
attachments
)
.
merge
(
Geo
::
FileRegistry
.
attachments
)
end
end
...
@@ -171,7 +171,7 @@ module Geo
...
@@ -171,7 +171,7 @@ module Geo
fdw_attachments
.
joins
(
"LEFT OUTER JOIN file_registry
fdw_attachments
.
joins
(
"LEFT OUTER JOIN file_registry
ON file_registry.file_id =
#{
fdw_attachments_table
}
.id
ON file_registry.file_id =
#{
fdw_attachments_table
}
.id
AND file_registry.file_type IN (
#{
upload_types
}
)"
)
AND file_registry.file_type IN (
#{
upload_types
}
)"
)
.
with_files_stored_locally
.
geo_syncable
.
where
(
file_registry:
{
id:
nil
})
.
where
(
file_registry:
{
id:
nil
})
.
where
.
not
(
id:
except_file_ids
)
.
where
.
not
(
id:
except_file_ids
)
end
end
...
...
ee/app/finders/geo/job_artifact_registry_finder.rb
View file @
e6a64aac
...
@@ -73,7 +73,7 @@ module Geo
...
@@ -73,7 +73,7 @@ module Geo
end
end
def
local_job_artifacts
def
local_job_artifacts
job_artifacts
.
with_files_stored_locally
job_artifacts
.
geo_syncable
end
end
def
find_retryable_failed_job_artifacts_registries
(
batch_size
:,
except_artifact_ids:
[])
def
find_retryable_failed_job_artifacts_registries
(
batch_size
:,
except_artifact_ids:
[])
...
@@ -134,13 +134,13 @@ module Geo
...
@@ -134,13 +134,13 @@ module Geo
def
fdw_find_job_artifacts
def
fdw_find_job_artifacts
fdw_job_artifacts
.
joins
(
"INNER JOIN job_artifact_registry ON job_artifact_registry.artifact_id =
#{
fdw_job_artifacts_table
}
.id"
)
fdw_job_artifacts
.
joins
(
"INNER JOIN job_artifact_registry ON job_artifact_registry.artifact_id =
#{
fdw_job_artifacts_table
}
.id"
)
.
with_files_stored_locally
.
geo_syncable
end
end
def
fdw_find_unsynced_job_artifacts
(
except_artifact_ids
:)
def
fdw_find_unsynced_job_artifacts
(
except_artifact_ids
:)
fdw_job_artifacts
.
joins
(
"LEFT OUTER JOIN job_artifact_registry
fdw_job_artifacts
.
joins
(
"LEFT OUTER JOIN job_artifact_registry
ON job_artifact_registry.artifact_id =
#{
fdw_job_artifacts_table
}
.id"
)
ON job_artifact_registry.artifact_id =
#{
fdw_job_artifacts_table
}
.id"
)
.
with_files_stored_locally
.
geo_syncable
.
where
(
job_artifact_registry:
{
artifact_id:
nil
})
.
where
(
job_artifact_registry:
{
artifact_id:
nil
})
.
where
.
not
(
id:
except_artifact_ids
)
.
where
.
not
(
id:
except_artifact_ids
)
end
end
...
...
ee/app/finders/geo/lfs_object_registry_finder.rb
View file @
e6a64aac
...
@@ -73,7 +73,7 @@ module Geo
...
@@ -73,7 +73,7 @@ module Geo
end
end
def
local_lfs_objects
def
local_lfs_objects
lfs_objects
.
with_files_stored_locally
lfs_objects
.
geo_syncable
end
end
def
find_retryable_failed_lfs_objects_registries
(
batch_size
:,
except_file_ids:
[])
def
find_retryable_failed_lfs_objects_registries
(
batch_size
:,
except_file_ids:
[])
...
@@ -122,7 +122,7 @@ module Geo
...
@@ -122,7 +122,7 @@ module Geo
def
fdw_find_lfs_objects
def
fdw_find_lfs_objects
fdw_lfs_objects
.
joins
(
"INNER JOIN file_registry ON file_registry.file_id =
#{
fdw_lfs_objects_table
}
.id"
)
fdw_lfs_objects
.
joins
(
"INNER JOIN file_registry ON file_registry.file_id =
#{
fdw_lfs_objects_table
}
.id"
)
.
with_files_stored_locally
.
geo_syncable
.
merge
(
Geo
::
FileRegistry
.
lfs_objects
)
.
merge
(
Geo
::
FileRegistry
.
lfs_objects
)
end
end
...
@@ -130,7 +130,7 @@ module Geo
...
@@ -130,7 +130,7 @@ module Geo
fdw_lfs_objects
.
joins
(
"LEFT OUTER JOIN file_registry
fdw_lfs_objects
.
joins
(
"LEFT OUTER JOIN file_registry
ON file_registry.file_id =
#{
fdw_lfs_objects_table
}
.id
ON file_registry.file_id =
#{
fdw_lfs_objects_table
}
.id
AND file_registry.file_type = 'lfs'"
)
AND file_registry.file_type = 'lfs'"
)
.
with_files_stored_locally
.
geo_syncable
.
where
(
file_registry:
{
id:
nil
})
.
where
(
file_registry:
{
id:
nil
})
.
where
.
not
(
id:
except_file_ids
)
.
where
.
not
(
id:
except_file_ids
)
end
end
...
...
ee/app/models/ee/ci/job_artifact.rb
View file @
e6a64aac
...
@@ -8,6 +8,8 @@ module EE
...
@@ -8,6 +8,8 @@ module EE
prepended
do
prepended
do
after_destroy
:log_geo_event
after_destroy
:log_geo_event
scope
:geo_syncable
,
->
{
with_files_stored_locally
}
end
end
private
private
...
...
ee/app/models/ee/lfs_object.rb
View file @
e6a64aac
...
@@ -8,6 +8,8 @@ module EE
...
@@ -8,6 +8,8 @@ module EE
prepended
do
prepended
do
after_destroy
:log_geo_event
after_destroy
:log_geo_event
scope
:geo_syncable
,
->
{
with_files_stored_locally
}
end
end
private
private
...
...
ee/app/models/ee/upload.rb
View file @
e6a64aac
...
@@ -8,6 +8,8 @@ module EE
...
@@ -8,6 +8,8 @@ module EE
prepended
do
prepended
do
after_destroy
:log_geo_event
after_destroy
:log_geo_event
scope
:geo_syncable
,
->
{
with_files_stored_locally
}
end
end
private
private
...
...
ee/app/models/geo/fdw/ci/job_artifact.rb
View file @
e6a64aac
...
@@ -6,6 +6,7 @@ module Geo
...
@@ -6,6 +6,7 @@ module Geo
scope
:with_files_stored_locally
,
->
{
where
(
file_store:
[
nil
,
JobArtifactUploader
::
Store
::
LOCAL
])
}
scope
:with_files_stored_locally
,
->
{
where
(
file_store:
[
nil
,
JobArtifactUploader
::
Store
::
LOCAL
])
}
scope
:with_files_stored_remotely
,
->
{
where
(
file_store:
JobArtifactUploader
::
Store
::
REMOTE
)
}
scope
:with_files_stored_remotely
,
->
{
where
(
file_store:
JobArtifactUploader
::
Store
::
REMOTE
)
}
scope
:geo_syncable
,
->
{
with_files_stored_locally
}
end
end
end
end
end
end
...
...
ee/app/models/geo/fdw/lfs_object.rb
View file @
e6a64aac
...
@@ -5,6 +5,7 @@ module Geo
...
@@ -5,6 +5,7 @@ module Geo
scope
:with_files_stored_locally
,
->
{
where
(
file_store:
[
nil
,
LfsObjectUploader
::
Store
::
LOCAL
])
}
scope
:with_files_stored_locally
,
->
{
where
(
file_store:
[
nil
,
LfsObjectUploader
::
Store
::
LOCAL
])
}
scope
:with_files_stored_remotely
,
->
{
where
(
file_store:
LfsObjectUploader
::
Store
::
REMOTE
)
}
scope
:with_files_stored_remotely
,
->
{
where
(
file_store:
LfsObjectUploader
::
Store
::
REMOTE
)
}
scope
:geo_syncable
,
->
{
with_files_stored_locally
}
end
end
end
end
end
end
ee/app/models/geo/fdw/upload.rb
View file @
e6a64aac
...
@@ -5,6 +5,7 @@ module Geo
...
@@ -5,6 +5,7 @@ module Geo
scope
:with_files_stored_locally
,
->
{
where
(
store:
[
nil
,
ObjectStorage
::
Store
::
LOCAL
])
}
scope
:with_files_stored_locally
,
->
{
where
(
store:
[
nil
,
ObjectStorage
::
Store
::
LOCAL
])
}
scope
:with_files_stored_remotely
,
->
{
where
(
store:
ObjectStorage
::
Store
::
REMOTE
)
}
scope
:with_files_stored_remotely
,
->
{
where
(
store:
ObjectStorage
::
Store
::
REMOTE
)
}
scope
:geo_syncable
,
->
{
with_files_stored_locally
}
end
end
end
end
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