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
ed6af70c
Commit
ed6af70c
authored
Jul 25, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate Geo logs to structured JSON in geo.log
parent
968f870e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
app/workers/geo/base_scheduler_worker.rb
app/workers/geo/base_scheduler_worker.rb
+11
-3
app/workers/geo/project_sync_worker.rb
app/workers/geo/project_sync_worker.rb
+7
-2
No files found.
app/workers/geo/base_scheduler_worker.rb
View file @
ed6af70c
...
...
@@ -27,7 +27,7 @@ module Geo
return
unless
Gitlab
::
Geo
.
geo_database_configured?
return
unless
Gitlab
::
Geo
.
secondary?
log
ger
.
info
"Started
#{
self
.
class
.
name
}
"
log
_info
(
'Started scheduler'
)
@start_time
=
Time
.
now
...
...
@@ -54,7 +54,7 @@ module Geo
sleep
(
1
)
end
log
ger
.
info
"Finished
#{
self
.
class
.
name
}
"
log
_info
(
'Finished scheduler'
)
end
end
...
...
@@ -128,7 +128,7 @@ module Geo
lease
=
exclusive_lease
.
try_obtain
unless
lease
log
ger
.
info
"
#{
self
.
class
.
name
}
: Cannot obtain an exclusive lease. There must be another worker already in execution."
log
_error
(
'Cannot obtain an exclusive lease. There must be another worker already in execution.'
)
return
end
...
...
@@ -160,5 +160,13 @@ module Geo
@current_node_enabled
||=
Gitlab
::
Geo
.
current_node_enabled?
end
def
log_info
(
message
)
Gitlab
::
Geo
::
Logger
.
info
(
class:
self
.
class
.
name
,
message:
message
)
end
def
log_error
(
message
)
Gitlab
::
Geo
::
Logger
.
error
(
class:
self
.
class
.
name
,
message:
message
)
end
end
end
app/workers/geo/project_sync_worker.rb
View file @
ed6af70c
...
...
@@ -16,8 +16,13 @@ module Geo
Geo
::
RepositorySyncService
.
new
(
project
).
execute
if
sync_repository?
(
registry
,
scheduled_time
)
Geo
::
WikiSyncService
.
new
(
project
).
execute
if
sync_wiki?
(
registry
,
scheduled_time
)
rescue
ActiveRecord
::
RecordNotFound
logger
.
error
(
"Couldn't find project with ID=
#{
project_id
}
, skipping syncing"
)
rescue
ActiveRecord
::
RecordNotFound
=>
e
Gitlab
::
Geo
::
Logger
.
error
(
class:
self
.
class
.
name
,
message:
"Couldn't find project, skipping syncing"
,
project_id:
project_id
,
error:
e
)
end
private
...
...
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