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
9f560516
Commit
9f560516
authored
Aug 23, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor Geo repository and Wiki sync logging
parent
bf89f1d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
24 deletions
+14
-24
app/services/geo/base_sync_service.rb
app/services/geo/base_sync_service.rb
+14
-2
app/services/geo/repository_sync_service.rb
app/services/geo/repository_sync_service.rb
+0
-10
app/services/geo/wiki_sync_service.rb
app/services/geo/wiki_sync_service.rb
+0
-12
No files found.
app/services/geo/base_sync_service.rb
View file @
9f560516
...
...
@@ -87,11 +87,23 @@ module Geo
end
def
update_delay_in_seconds
raise
NotImplementedError
,
'This class should implement update_delay_in_seconds method'
# We don't track the last update time of repositories and Wiki
# separately in the main database
return
unless
project
.
last_repository_updated_at
(
last_successful_sync_at
.
to_f
-
project
.
last_repository_updated_at
.
to_f
).
round
(
3
)
end
def
download_time_in_seconds
raise
NotImplementedError
,
'This class should implement download_time_in_seconds method'
(
last_successful_sync_at
.
to_f
-
last_synced_at
.
to_f
).
round
(
3
)
end
def
last_successful_sync_at
registry
.
public_send
(
"last_
#{
type
}
_successful_sync_at"
)
end
def
last_synced_at
registry
.
public_send
(
"last_
#{
type
}
_synced_at"
)
end
end
end
app/services/geo/repository_sync_service.rb
View file @
9f560516
...
...
@@ -38,15 +38,5 @@ module Geo
def
ssh_url_to_repo
"
#{
primary_ssh_path_prefix
}#{
project
.
full_path
}
.git"
end
def
update_delay_in_seconds
return
unless
project
.
last_repository_updated_at
(
registry
.
last_repository_successful_sync_at
.
to_f
-
project
.
last_repository_updated_at
.
to_f
).
round
(
3
)
end
def
download_time_in_seconds
(
registry
.
last_repository_successful_sync_at
-
registry
.
last_repository_synced_at
).
to_f
.
round
(
3
)
end
end
end
app/services/geo/wiki_sync_service.rb
View file @
9f560516
...
...
@@ -31,17 +31,5 @@ module Geo
def
ssh_url_to_wiki
"
#{
primary_ssh_path_prefix
}#{
project
.
full_path
}
.wiki.git"
end
def
update_delay_in_seconds
# We don't track the last update time of repositories and Wiki
# separately in the main database
return
unless
project
.
last_repository_updated_at
(
registry
.
last_wiki_successful_sync_at
.
to_f
-
project
.
last_repository_updated_at
.
to_f
).
round
(
3
)
end
def
download_time_in_seconds
(
registry
.
last_wiki_successful_sync_at
-
registry
.
last_wiki_synced_at
).
to_f
.
round
(
3
)
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