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
e9be0cc6
Commit
e9be0cc6
authored
May 30, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor the node_enabled? method on Geo workers to make it more clear
parent
222aa91d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
app/workers/geo_file_download_dispatch_worker.rb
app/workers/geo_file_download_dispatch_worker.rb
+1
-1
app/workers/geo_repository_sync_worker.rb
app/workers/geo_repository_sync_worker.rb
+1
-1
No files found.
app/workers/geo_file_download_dispatch_worker.rb
View file @
e9be0cc6
...
@@ -153,7 +153,7 @@ class GeoFileDownloadDispatchWorker
...
@@ -153,7 +153,7 @@ class GeoFileDownloadDispatchWorker
def
node_enabled?
def
node_enabled?
# Only check every minute to avoid polling the DB excessively
# Only check every minute to avoid polling the DB excessively
unless
@last_enabled_check
.
present?
&&
(
Time
.
now
-
@last_enabled_check
>
1
.
minute
)
unless
@last_enabled_check
.
present?
&&
@last_enabled_check
>
1
.
minute
.
ago
@last_enabled_check
=
Time
.
now
@last_enabled_check
=
Time
.
now
@current_node_enabled
=
nil
@current_node_enabled
=
nil
end
end
...
...
app/workers/geo_repository_sync_worker.rb
View file @
e9be0cc6
...
@@ -75,7 +75,7 @@ class GeoRepositorySyncWorker
...
@@ -75,7 +75,7 @@ class GeoRepositorySyncWorker
def
node_enabled?
def
node_enabled?
# Only check every minute to avoid polling the DB excessively
# Only check every minute to avoid polling the DB excessively
unless
@last_enabled_check
.
present?
&&
(
Time
.
now
-
@last_enabled_check
>
1
.
minute
)
unless
@last_enabled_check
.
present?
&&
@last_enabled_check
>
1
.
minute
.
ago
@last_enabled_check
=
Time
.
now
@last_enabled_check
=
Time
.
now
@current_node_enabled
=
nil
@current_node_enabled
=
nil
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