mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 14:56:22 +00:00
Merge branch 'blazer' into panel.sutty.nl
This commit is contained in:
commit
3c482e28cf
3 changed files with 7 additions and 4 deletions
|
@ -14,7 +14,7 @@ ENV RAILS_ENV production
|
||||||
# principal
|
# principal
|
||||||
RUN apk add --no-cache libxslt libxml2 postgresql-libs libssh2 \
|
RUN apk add --no-cache libxslt libxml2 postgresql-libs libssh2 \
|
||||||
rsync git jpegoptim vips tectonic oxipng git-lfs openssh-client \
|
rsync git jpegoptim vips tectonic oxipng git-lfs openssh-client \
|
||||||
yarn daemonize ruby-webrick postgresql-client
|
yarn daemonize ruby-webrick postgresql-client dateutils
|
||||||
|
|
||||||
RUN gem install --no-document --no-user-install foreman
|
RUN gem install --no-document --no-user-install foreman
|
||||||
RUN wget https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz -O - | tar --strip-components 1 -xvzf - pandoc-${PANDOC_VERSION}/bin/pandoc && mv /bin/pandoc /usr/bin/pandoc
|
RUN wget https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz -O - | tar --strip-components 1 -xvzf - pandoc-${PANDOC_VERSION}/bin/pandoc && mv /bin/pandoc /usr/bin/pandoc
|
||||||
|
|
|
@ -47,7 +47,7 @@ class StatCollectionJob < PeriodicJob
|
||||||
def scope
|
def scope
|
||||||
@scope ||= site.build_stats
|
@scope ||= site.build_stats
|
||||||
.jekyll
|
.jekyll
|
||||||
.where('created_at => ?', beginning_of_interval)
|
.where('created_at >= ?', beginning_of_interval)
|
||||||
.group(:site_id)
|
.group(:site_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,12 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Volcar y eliminar todos los access logs de dos días atrás
|
# Volcar y eliminar todos los access logs de dos días atrás
|
||||||
date=`bundle exec rails runner "puts (Date.today - 2.days)"`
|
date="`dateadd today -1d`"
|
||||||
|
file="/srv/_storage/${date}.psql.gz"
|
||||||
|
test -n "${date}"
|
||||||
|
test ! -f "${file}"
|
||||||
|
|
||||||
psql -h postgresql "${DATABASE:-sutty}" sutty <<SQL | gzip > "/srv/_storage/${date}.psql.gz"
|
psql -h postgresql "${DATABASE:-sutty}" sutty <<SQL | gzip > "${file}"
|
||||||
begin;
|
begin;
|
||||||
copy (select * from access_logs where created_at < '${date}') to stdout;
|
copy (select * from access_logs where created_at < '${date}') to stdout;
|
||||||
delete from access_logs where created_at < '${date}';
|
delete from access_logs where created_at < '${date}';
|
||||||
|
|
Loading…
Reference in a new issue