2019-04-03 18:18:56 +05:30
|
|
|
namespace :gitlab do
|
|
|
|
namespace :uploads do
|
|
|
|
namespace :sanitize do
|
|
|
|
desc 'GitLab | Uploads | Remove EXIF from images.'
|
2019-09-04 21:01:54 +05:30
|
|
|
task :remove_exif, [:start_id, :stop_id, :dry_run, :sleep_time, :uploader, :since] => :environment do |task, args|
|
2019-04-03 18:18:56 +05:30
|
|
|
args.with_defaults(dry_run: 'true')
|
|
|
|
args.with_defaults(sleep_time: 0.3)
|
|
|
|
|
|
|
|
logger = Logger.new(STDOUT)
|
|
|
|
|
|
|
|
sanitizer = Gitlab::Sanitizers::Exif.new(logger: logger)
|
|
|
|
sanitizer.batch_clean(start_id: args.start_id, stop_id: args.stop_id,
|
|
|
|
dry_run: args.dry_run != 'false',
|
2019-09-04 21:01:54 +05:30
|
|
|
sleep_time: args.sleep_time.to_f,
|
|
|
|
uploader: args.uploader,
|
|
|
|
since: args.since)
|
2019-04-03 18:18:56 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|