Class: C3D::Purger
Instance Method Summary collapse
-
#initialize(blob) ⇒ Purger
constructor
A new instance of Purger.
Constructor Details
#initialize(blob) ⇒ Purger
Returns a new instance of Purger.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/c3d/util/purger.rb', line 7 def initialize blob begin dn = blob[14..-1] currently_downloading = Celluloid::Actor[:puller].all downloading = currently_downloading.select{|t| t["name"] == dn}.first["id"] Celluloid::Actor[:puller].destroy downloading if downloading blob_file = File.join(ENV['BLOBS_DIR'], dn) if File.exists? blob_file File.delete blob_file end rescue return end end |