diff options
author | Rémy Coutable <remy@rymai.me> | 2019-01-21 22:20:38 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-02-05 16:04:54 +0300 |
commit | 6b39f55d3f0ba0d48e920693c4d5128e26769a1c (patch) | |
tree | a55eae5d31118fa44d902a932ea638163356d3ed /lib/gitlab | |
parent | 31fc5965baf9ca23a1da4a0ffc350102fe4c89c6 (diff) |
Add cache to the 'compile-assets' and 'gitlab:assets:compile' jobs
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/task_helpers.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/utils/merge_hash.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/utils/override.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/utils/strong_memoize.rb | 2 |
4 files changed, 13 insertions, 1 deletions
diff --git a/lib/gitlab/task_helpers.rb b/lib/gitlab/task_helpers.rb index 224bb648d8f..8532845f3cb 100644 --- a/lib/gitlab/task_helpers.rb +++ b/lib/gitlab/task_helpers.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rainbow/ext/string' -require 'gitlab/utils/strong_memoize' +require_dependency 'gitlab/utils/strong_memoize' # rubocop:disable Rails/Output module Gitlab @@ -13,6 +13,12 @@ module Gitlab extend self + def invoke_and_time_task(task) + start = Time.now + Rake::Task[task].invoke + puts "`#{task}` finished in #{Time.now - start} seconds" + end + # Ask if the user wants to continue # # Returns "yes" the user chose to continue diff --git a/lib/gitlab/utils/merge_hash.rb b/lib/gitlab/utils/merge_hash.rb index fc237861e2f..48ba13b8561 100644 --- a/lib/gitlab/utils/merge_hash.rb +++ b/lib/gitlab/utils/merge_hash.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require_dependency 'gitlab/utils' + module Gitlab module Utils module MergeHash diff --git a/lib/gitlab/utils/override.rb b/lib/gitlab/utils/override.rb index c87e97d0213..f5299439fce 100644 --- a/lib/gitlab/utils/override.rb +++ b/lib/gitlab/utils/override.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require_dependency 'gitlab/utils' + module Gitlab module Utils module Override diff --git a/lib/gitlab/utils/strong_memoize.rb b/lib/gitlab/utils/strong_memoize.rb index aa1f8e2fdda..3021a91dd83 100644 --- a/lib/gitlab/utils/strong_memoize.rb +++ b/lib/gitlab/utils/strong_memoize.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require_dependency 'gitlab/utils' + module Gitlab module Utils module StrongMemoize |