-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add improved CLI interface for removing remote media #8411
Conversation
c686ba5
to
c3dcd51
Compare
./bin/tootctl media remove --days 7 --background Make the old rake task point to it
c3dcd51
to
127d4d5
Compare
I'm not sure about adding yet another interface. |
@ThibG I intend to fully remove the rake interface, but feeling some pressure to release 2.5 soon, I don't feel like I have the time to rewrite everything at once. The problem with rake is the argument system. To use any kind of arguments for commands, I have to either use rake's insane syntax ( With this new interface, I can split it into multiple, organized files, and the options and arguments handling is built in. |
end | ||
puts "Scheduled the deletion of #{nb_media_attachments} media attachments" | ||
require_relative '../mastodon/media_cli' | ||
cli = Mastodon::MediaCLI.new([], days: ENV['NUM_DAYS'] || 7) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that ".to_i" is requires for "['NUM_DAYS']".
However, I still feel that it is not working properly.
I executed next line.
RAILS_ENV=production NUM_DAYS=60 bundle exec rake mastodon:media:remove_remote
After that, when I executed next line, multiple jobs were added to Sidekiq.
RAILS_ENV=production bundle exec bin/tootctl media remove --days 60 --background
./bin/tootctl media remove --days 7 --background Make the old rake task point to it
Make the old rake task point to it. Benefits: It lets you choose whether to process files sequentially, or in background.
Fix #8187