Created
December 26, 2016 03:00
-
-
Save Chryus/f8b87bd32c746cf29c26d7074e621535 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './app/services/fog_service' | |
require 'task_helpers/clean_up_helper' | |
task :upload_jobs do | |
Dir.glob("tmp/uploads/*/*.*") do |file| | |
age = CleanUpHelper.file_age(file) | |
if age > 300 | |
fog = FogService.create | |
destination = fog.directories.get('default-submissions-uploads') | |
destination.files.create(key: file.split("/").last, body: File.read(file)) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment