diff options
author | John Jarvis <jarv@gitlab.com> | 2019-04-02 10:12:32 +0200 |
---|---|---|
committer | John Jarvis <jarv@gitlab.com> | 2019-04-02 10:12:32 +0200 |
commit | 69b65a6b745e74bba290787420a0017395fd7c25 (patch) | |
tree | c328963cbe5b340c58c88230d21f338c77462ebd /lib/tasks | |
parent | 1b6fe3ae226e4c6f481c90c886e242fcd96ab11b (diff) | |
parent | 3e81a5baf25d6ecd9ad807a2b8f4238dcc598d5e (diff) | |
download | gitlab-ce-69b65a6b745e74bba290787420a0017395fd7c25.tar.gz |
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into jarv/dev-to-gitlab-2019-04-02jarv/dev-to-gitlab-2019-04-02
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gitlab/uploads/sanitize.rake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/tasks/gitlab/uploads/sanitize.rake b/lib/tasks/gitlab/uploads/sanitize.rake new file mode 100644 index 00000000000..12cf5302555 --- /dev/null +++ b/lib/tasks/gitlab/uploads/sanitize.rake @@ -0,0 +1,18 @@ +namespace :gitlab do + namespace :uploads do + namespace :sanitize do + desc 'GitLab | Uploads | Remove EXIF from images.' + task :remove_exif, [:start_id, :stop_id, :dry_run, :sleep_time] => :environment do |task, args| + 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', + sleep_time: args.sleep_time.to_f) + end + end + end +end |