about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorAnthony Bellew <anthonyreflected@gmail.com>2017-01-25 20:53:57 -0700
committerGitHub <noreply@github.com>2017-01-25 20:53:57 -0700
commit3d890c407356c8e0e7dd9b64e8e232ededcff8e8 (patch)
treea22df9a8737250f97a6024943af3445a163917b3 /lib
parentfebe2449bb14f3d877fb934ceb6d52e320712bac (diff)
parent905c82917959a5afe24cb85c62c0b0ba13f0da8b (diff)
Merge pull request #3 from tootsuite/master
Updating to current
Diffstat (limited to 'lib')
-rw-r--r--lib/statsd_monitor.rb11
-rw-r--r--lib/tasks/mastodon.rake5
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/statsd_monitor.rb b/lib/statsd_monitor.rb
new file mode 100644
index 000000000..e48ce6541
--- /dev/null
+++ b/lib/statsd_monitor.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class StatsDMonitor
+  def initialize(app)
+    @app = app
+  end
+
+  def call(env)
+    @app.call(env)
+  end
+end
diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake
index a95a7258f..13220f68e 100644
--- a/lib/tasks/mastodon.rake
+++ b/lib/tasks/mastodon.rake
@@ -6,6 +6,11 @@ namespace :mastodon do
     task clear: :environment do
       MediaAttachment.where(status_id: nil).where('created_at < ?', 1.day.ago).find_each(&:destroy)
     end
+
+    desc 'Remove media attachments attributed to silenced accounts'
+    task remove_silenced: :environment do
+      MediaAttachment.where(account: Account.silenced).find_each(&:destroy)
+    end
   end
 
   namespace :push do