Closed ghost closed 9 months ago
What would you like to do on the workers? Do you need to generate a ZIP file and store it on the worker filesystem? I would suspect zipline is built for adding it to a controller - so for serving ZIPs from the web. The zipline method expects the API of the object it gets called on to support all kinds of ActionController methods, i.e. the ones for setting headers
For reference, if you want to use it in a background job, you need to go one abstraction layer down, like so:
Tempfile.open("temp.zip") do |tf|
tf.binmode
zip_generator = Zipline::ZipGenerator.new(files)
zip_generator.each { |bytes| tf.write(bytes) }
tf.rewind
# Do something with your tempfile, as it gets removed when you exit `Tempfile.open`
end
I'm trying to use zipline on a worker but seems that is not posible doue to the following error: