about summary refs log tree commit diff
path: root/lib/mastodon/cache_cli.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-05-04 01:02:57 +0200
committerGitHub <noreply@github.com>2019-05-04 01:02:57 +0200
commit8025a41a1ff2ae1cd7c36a2baac36d3e2badb75d (patch)
tree4fa6bfae502d1aaf5dc93cd0cfd3a679128ddc54 /lib/mastodon/cache_cli.rb
parent5f9f610a23c8fac1133250a95de567e68cad183c (diff)
Add `tootctl cache clear` (#10689)
Diffstat (limited to 'lib/mastodon/cache_cli.rb')
-rw-r--r--lib/mastodon/cache_cli.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/mastodon/cache_cli.rb b/lib/mastodon/cache_cli.rb
new file mode 100644
index 000000000..e9b6667b3
--- /dev/null
+++ b/lib/mastodon/cache_cli.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+require_relative '../../config/boot'
+require_relative '../../config/environment'
+require_relative 'cli_helper'
+
+module Mastodon
+  class CacheCLI < Thor
+    def self.exit_on_failure?
+      true
+    end
+
+    desc 'clear', 'Clear out the cache storage'
+    def clear
+      Rails.cache.clear
+      say('OK', :green)
+    end
+  end
+end