5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-23 02:16:22 +00:00

Merge branch 'blazer' into panel.sutty.nl

This commit is contained in:
f 2022-04-23 18:06:39 -03:00
commit 03322e0636
3 changed files with 16 additions and 17 deletions

View file

@ -6,15 +6,6 @@ GIT
rails (>= 3.0) rails (>= 3.0)
rake (>= 0.8.7) rake (>= 0.8.7)
GIT
remote: https://github.com/ankane/rollup.git
revision: 0ab6c603450175eb1004f7793e86486943cb9f72
branch: master
specs:
rollups (0.1.3)
activesupport (>= 5.1)
groupdate (>= 5.2)
GIT GIT
remote: https://github.com/fauno/email_address remote: https://github.com/fauno/email_address
revision: 536b51f7071b68a55140c0c1726b4cd401d1c04d revision: 536b51f7071b68a55140c0c1726b4cd401d1c04d
@ -24,6 +15,15 @@ GIT
netaddr (>= 2.0.4, < 3) netaddr (>= 2.0.4, < 3)
simpleidn simpleidn
GIT
remote: https://github.com/fauno/rollup.git
revision: ddbb345aa57e63b4cfdf7557267efa89ba60caac
branch: update
specs:
rollups (0.1.3)
activesupport (>= 5.1)
groupdate (>= 5.2)
GEM GEM
remote: https://gems.sutty.nl/ remote: https://gems.sutty.nl/
specs: specs:
@ -243,8 +243,8 @@ GEM
ffi (~> 1.0) ffi (~> 1.0)
globalid (0.6.0) globalid (0.6.0)
activesupport (>= 5.0) activesupport (>= 5.0)
groupdate (5.2.2) groupdate (6.1.0)
activesupport (>= 5) activesupport (>= 5.2)
hairtrigger (0.2.24) hairtrigger (0.2.24)
activerecord (>= 5.0, < 7) activerecord (>= 5.0, < 7)
ruby2ruby (~> 2.4) ruby2ruby (~> 2.4)

View file

@ -19,9 +19,12 @@ class UriCollectionJob < PeriodicJob
def perform(site_id:, once: true) def perform(site_id:, once: true)
@site = Site.find site_id @site = Site.find site_id
# Recordar la última vez que se corrió la tarea
stat = site.stats.create! name: STAT_NAME
hostnames.each do |hostname| hostnames.each do |hostname|
uris.each do |uri| uris.each do |uri|
return if stop? next if stop?
AccessLog.where(host: hostname, uri: uri) AccessLog.where(host: hostname, uri: uri)
.where('created_at >= ?', beginning_of_interval) .where('created_at >= ?', beginning_of_interval)
@ -46,8 +49,7 @@ class UriCollectionJob < PeriodicJob
end end
end end
# Recordar la última vez que se corrió la tarea stat.touch
site.stats.create! name: STAT_NAME
run_again! unless once run_again! unless once
end end

View file

@ -36,9 +36,6 @@ Rails.application.routes.draw do
match '/api/v3/projects/:site_id/notices' => 'api/v1/notices#create', via: %i[post] match '/api/v3/projects/:site_id/notices' => 'api/v1/notices#create', via: %i[post]
resources :sites, constraints: { site_id: %r{[^/]+}, id: %r{[^/]+} } do resources :sites, constraints: { site_id: %r{[^/]+}, id: %r{[^/]+} } do
# Usar Blazer para mostrar estadísticas
mount Blazer::Engine, at: 'stats', as: 'stats'
# Gestionar actualizaciones del sitio # Gestionar actualizaciones del sitio
get 'pull', to: 'sites#fetch' get 'pull', to: 'sites#fetch'
post 'pull', to: 'sites#merge' post 'pull', to: 'sites#merge'