Merge commit '5a437edc7f22d5797e5af29d9b450a03eccec304' into glitch-soc/merge-upstream
commit
a5dbb1ee5a
|
@ -282,8 +282,8 @@ jobs:
|
||||||
ports:
|
ports:
|
||||||
- 6379:6379
|
- 6379:6379
|
||||||
|
|
||||||
elasticsearch:
|
search:
|
||||||
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.13
|
image: ${{ matrix.search-image }}
|
||||||
env:
|
env:
|
||||||
discovery.type: single-node
|
discovery.type: single-node
|
||||||
xpack.security.enabled: false
|
xpack.security.enabled: false
|
||||||
|
@ -313,6 +313,11 @@ jobs:
|
||||||
- '3.0'
|
- '3.0'
|
||||||
- '3.1'
|
- '3.1'
|
||||||
- '.ruby-version'
|
- '.ruby-version'
|
||||||
|
search-image:
|
||||||
|
- docker.elastic.co/elasticsearch/elasticsearch:7.17.13
|
||||||
|
include:
|
||||||
|
- ruby-version: '.ruby-version'
|
||||||
|
search-image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
10
Gemfile.lock
10
Gemfile.lock
|
@ -324,7 +324,7 @@ GEM
|
||||||
ruby-progressbar (~> 1.4)
|
ruby-progressbar (~> 1.4)
|
||||||
globalid (1.1.0)
|
globalid (1.1.0)
|
||||||
activesupport (>= 5.0)
|
activesupport (>= 5.0)
|
||||||
haml (6.1.2)
|
haml (6.2.0)
|
||||||
temple (>= 0.8.2)
|
temple (>= 0.8.2)
|
||||||
thor
|
thor
|
||||||
tilt
|
tilt
|
||||||
|
@ -333,8 +333,8 @@ GEM
|
||||||
activesupport (>= 5.1)
|
activesupport (>= 5.1)
|
||||||
haml (>= 4.0.6)
|
haml (>= 4.0.6)
|
||||||
railties (>= 5.1)
|
railties (>= 5.1)
|
||||||
haml_lint (0.50.0)
|
haml_lint (0.51.0)
|
||||||
haml (>= 4.0, < 6.2)
|
haml (>= 4.0)
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
rainbow
|
rainbow
|
||||||
rubocop (>= 1.0)
|
rubocop (>= 1.0)
|
||||||
|
@ -747,7 +747,7 @@ GEM
|
||||||
climate_control (>= 0.0.3, < 1.0)
|
climate_control (>= 0.0.3, < 1.0)
|
||||||
test-prof (1.2.3)
|
test-prof (1.2.3)
|
||||||
thor (1.2.2)
|
thor (1.2.2)
|
||||||
tilt (2.2.0)
|
tilt (2.3.0)
|
||||||
timeout (0.4.0)
|
timeout (0.4.0)
|
||||||
tpm-key_attestation (0.12.0)
|
tpm-key_attestation (0.12.0)
|
||||||
bindata (~> 2.4)
|
bindata (~> 2.4)
|
||||||
|
@ -773,7 +773,7 @@ GEM
|
||||||
unf (0.1.4)
|
unf (0.1.4)
|
||||||
unf_ext
|
unf_ext
|
||||||
unf_ext (0.0.8.2)
|
unf_ext (0.0.8.2)
|
||||||
unicode-display_width (2.4.2)
|
unicode-display_width (2.5.0)
|
||||||
uri (0.12.2)
|
uri (0.12.2)
|
||||||
validate_email (0.1.6)
|
validate_email (0.1.6)
|
||||||
activemodel (>= 3.0)
|
activemodel (>= 3.0)
|
||||||
|
|
|
@ -100,7 +100,7 @@ class LinkFooter extends PureComponent {
|
||||||
{DividingCircle}
|
{DividingCircle}
|
||||||
<a href={source_url} rel='noopener noreferrer' target='_blank'><FormattedMessage id='footer.source_code' defaultMessage='View source code' /></a>
|
<a href={source_url} rel='noopener noreferrer' target='_blank'><FormattedMessage id='footer.source_code' defaultMessage='View source code' /></a>
|
||||||
{DividingCircle}
|
{DividingCircle}
|
||||||
v{version}
|
<span class='version'>v{version}</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -9009,6 +9009,10 @@ noscript {
|
||||||
color: $dark-text-color;
|
color: $dark-text-color;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
|
||||||
|
.version {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
strong {
|
strong {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,9 @@ class Importer::BaseImporter
|
||||||
# Estimate the amount of documents that would be indexed. Not exact!
|
# Estimate the amount of documents that would be indexed. Not exact!
|
||||||
# @returns [Integer]
|
# @returns [Integer]
|
||||||
def estimate!
|
def estimate!
|
||||||
ActiveRecord::Base.connection_pool.with_connection { |connection| connection.select_one("SELECT reltuples AS estimate FROM pg_class WHERE relname = '#{index.adapter.target.table_name}'")['estimate'].to_i }
|
reltuples = ActiveRecord::Base.connection_pool.with_connection { |connection| connection.select_one("SELECT reltuples FROM pg_class WHERE relname = '#{index.adapter.target.table_name}'")['reltuples'].to_i }
|
||||||
|
# If the table has never yet been vacuumed or analyzed, reltuples contains -1
|
||||||
|
[reltuples, 0].max
|
||||||
end
|
end
|
||||||
|
|
||||||
# Import data from the database into the index
|
# Import data from the database into the index
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class BackupPolicy < ApplicationPolicy
|
class BackupPolicy < ApplicationPolicy
|
||||||
MIN_AGE = 1.week
|
MIN_AGE = 6.days
|
||||||
|
|
||||||
def create?
|
def create?
|
||||||
user_signed_in? && current_user.backups.where('created_at >= ?', MIN_AGE.ago).count.zero?
|
user_signed_in? && current_user.backups.where('created_at >= ?', MIN_AGE.ago).count.zero?
|
||||||
|
|
Loading…
Reference in New Issue