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
b9951380
Commit
b9951380
authored
Mar 01, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor Geo::HealthCheck.get_migration_version to be more clear
parent
74f0a621
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
lib/gitlab/geo/health_check.rb
lib/gitlab/geo/health_check.rb
+5
-2
No files found.
lib/gitlab/geo/health_check.rb
View file @
b9951380
...
@@ -40,8 +40,11 @@ module Gitlab
...
@@ -40,8 +40,11 @@ module Gitlab
latest_migration
=
nil
latest_migration
=
nil
Dir
[
File
.
join
(
self
.
db_migrate_path
,
"[0-9]*_*.rb"
)].
each
do
|
f
|
Dir
[
File
.
join
(
self
.
db_migrate_path
,
"[0-9]*_*.rb"
)].
each
do
|
f
|
l
=
f
.
scan
(
/0*([0-9]+)_[_.a-zA-Z0-9]*.rb/
).
first
.
first
rescue
-
1
timestamp
=
f
.
scan
(
/0*([0-9]+)_[_.a-zA-Z0-9]*.rb/
).
first
.
first
rescue
-
1
latest_migration
=
l
if
!
latest_migration
||
l
.
to_i
>
latest_migration
.
to_i
if
latest_migration
.
nil?
||
timestamp
.
to_i
>
latest_migration
.
to_i
latest_migration
=
timestamp
end
end
end
latest_migration
latest_migration
...
...
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