mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 03:36:22 +00:00
Merge branch 'blazer' into panel.sutty.nl
This commit is contained in:
commit
82eb6e49dd
3 changed files with 17 additions and 0 deletions
1
Procfile
1
Procfile
|
@ -1 +1,2 @@
|
||||||
cleanup: rake cleanup:everything
|
cleanup: rake cleanup:everything
|
||||||
|
stats: bundle exec rake stats:process_all
|
||||||
|
|
11
lib/tasks/stats.rake
Normal file
11
lib/tasks/stats.rake
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
namespace :stats do
|
||||||
|
desc 'Process stats'
|
||||||
|
task process_all: :environment do
|
||||||
|
Site.all.pluck(:id).each do |site_id|
|
||||||
|
UriCollectionJob.perform_now site_id: site_id, once: true
|
||||||
|
StatCollectionJob.perform_now site_id: site_id, once: true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -8,3 +8,8 @@ check program access_logs
|
||||||
with path "/srv/bin/access_logs" as uid "rails" and gid "www-data"
|
with path "/srv/bin/access_logs" as uid "rails" and gid "www-data"
|
||||||
every "0 0 * * *"
|
every "0 0 * * *"
|
||||||
if status != 0 then alert
|
if status != 0 then alert
|
||||||
|
|
||||||
|
check program stats
|
||||||
|
with path "/usr/bin/foreman run -f /srv/Procfile -d /srv stats" as uid "rails" gid "www-data"
|
||||||
|
every "0 1 * * *"
|
||||||
|
if status != 0 then alert
|
||||||
|
|
Loading…
Reference in a new issue