Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-24 09:09:01 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-24 09:09:01 +0300
commitfa7ac2663b53f61551b9db51f16d55fa4e5b74c3 (patch)
tree0cbf33baee16b10803c1d23ec9e0c06e238e43f5 /app/workers
parent4870899d6cec693b58acbef91636e1310160fa28 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/concerns/reenqueuer.rb4
-rw-r--r--app/workers/gitlab/jira_import/import_issue_worker.rb2
-rw-r--r--app/workers/process_commit_worker.rb2
-rw-r--r--app/workers/repository_check/batch_worker.rb4
-rw-r--r--app/workers/repository_check/single_repository_worker.rb2
5 files changed, 7 insertions, 7 deletions
diff --git a/app/workers/concerns/reenqueuer.rb b/app/workers/concerns/reenqueuer.rb
index 5cc13e490d8..79a1d2d0070 100644
--- a/app/workers/concerns/reenqueuer.rb
+++ b/app/workers/concerns/reenqueuer.rb
@@ -73,7 +73,7 @@ module Reenqueuer
# end
#
def ensure_minimum_duration(minimum_duration)
- start_time = Time.now
+ start_time = Time.current
result = yield
@@ -95,7 +95,7 @@ module Reenqueuer
end
def elapsed_time(start_time)
- Time.now - start_time
+ Time.current - start_time
end
end
end
diff --git a/app/workers/gitlab/jira_import/import_issue_worker.rb b/app/workers/gitlab/jira_import/import_issue_worker.rb
index 7709d2ec31b..d1ceda4fd6a 100644
--- a/app/workers/gitlab/jira_import/import_issue_worker.rb
+++ b/app/workers/gitlab/jira_import/import_issue_worker.rb
@@ -62,7 +62,7 @@ module Gitlab
end
def build_label_attrs(issue_id, label_id)
- time = Time.now
+ time = Time.current
{
label_id: label_id,
target_id: issue_id,
diff --git a/app/workers/process_commit_worker.rb b/app/workers/process_commit_worker.rb
index 5756ebb8358..3c7af641f16 100644
--- a/app/workers/process_commit_worker.rb
+++ b/app/workers/process_commit_worker.rb
@@ -80,7 +80,7 @@ class ProcessCommitWorker
# manually parse these values.
hash.each do |key, value|
if key.to_s.end_with?(date_suffix) && value.is_a?(String)
- hash[key] = Time.parse(value)
+ hash[key] = Time.zone.parse(value)
end
end
diff --git a/app/workers/repository_check/batch_worker.rb b/app/workers/repository_check/batch_worker.rb
index 1e2cb912598..d47f738ccb0 100644
--- a/app/workers/repository_check/batch_worker.rb
+++ b/app/workers/repository_check/batch_worker.rb
@@ -34,7 +34,7 @@ module RepositoryCheck
end
def perform_repository_checks
- start = Time.now
+ start = Time.current
# This loop will break after a little more than one hour ('a little
# more' because `git fsck` may take a few minutes), or if it runs out of
@@ -42,7 +42,7 @@ module RepositoryCheck
# RepositoryCheckWorker each hour so that as long as there are repositories to
# check, only one (or two) will be checked at a time.
project_ids.each do |project_id|
- break if Time.now - start >= RUN_TIME
+ break if Time.current - start >= RUN_TIME
next unless try_obtain_lease_for_project(project_id)
diff --git a/app/workers/repository_check/single_repository_worker.rb b/app/workers/repository_check/single_repository_worker.rb
index edff7fc31df..d757b87c23a 100644
--- a/app/workers/repository_check/single_repository_worker.rb
+++ b/app/workers/repository_check/single_repository_worker.rb
@@ -17,7 +17,7 @@ module RepositoryCheck
def update_repository_check_status(project, healthy)
project.update_columns(
last_repository_check_failed: !healthy,
- last_repository_check_at: Time.now
+ last_repository_check_at: Time.current
)
end