Skip to content

Commit f6ad438

Browse files
author
root
committed
Extend Redmine check_cache method to flush our internal cache
1 parent c749d5f commit f6ad438

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Diff for: lib/redmine_git_hosting/config/gitolite_base.rb

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ def included(receiver)
1414
module ClassMethods
1515

1616

17+
def check_cache
18+
@gitolite_home_dir = nil
19+
end
20+
21+
1722
def redmine_user
1823
@redmine_user ||= (%x[whoami]).chomp.strip
1924
end

Diff for: lib/redmine_git_hosting/patches/setting_patch.rb

+16
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,31 @@ module Patches
55
module SettingPatch
66

77
def self.included(base)
8+
base.send(:extend, ClassMethods)
89
base.send(:include, InstanceMethods)
910
base.class_eval do
1011
unloadable
1112

1213
before_save :save_git_hosting_values
1314
after_commit :restore_git_hosting_values
15+
16+
class << self
17+
alias_method_chain :check_cache, :git_hosting
18+
end
1419
end
1520
end
1621

22+
23+
module ClassMethods
24+
25+
def check_cache_with_git_hosting
26+
check_cache_without_git_hosting
27+
RedmineGitHosting::Config.check_cache
28+
end
29+
30+
end
31+
32+
1733
module InstanceMethods
1834

1935
private

0 commit comments

Comments
 (0)