Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/redmine_git_hosting/cache/abstract_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ def logger
def time_limit
return if max_cache_time.to_i.negative? # No expiration needed

current_time = ActiveRecord::Base.default_timezone == :utc ? Time.now.utc : Time.zone.now
current_time = ActiveRecord.default_timezone == :utc ? Time.now.utc : Time.zone.now
current_time - max_cache_time
end

def valid_cache_entry?(cached_entry_date)
return true if max_cache_time.to_i.negative? # No expiration needed

current_time = ActiveRecord::Base.default_timezone == :utc ? Time.now.utc : Time.zone.now
current_time = ActiveRecord.default_timezone == :utc ? Time.now.utc : Time.zone.now
expired = current_time.to_i - cached_entry_date.to_i > max_cache_time
!expired
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def diff_with_options
@changeset = @repository.find_changeset_by_name @rev
@changeset_to = @rev_to ? @repository.find_changeset_by_name(@rev_to) : nil
@diff_format_revisions = @repository.diff_format_revisions @changeset, @changeset_to
render :diff, formats: :html, layout: 'base.html.erb'
render :diff, formats: :html, layout: 'base'
end
end
end
Expand Down
Loading