# Params\[:file\] attributes lost within Scheduler::Defer

**URL:** <https://meta.discourse.org/t/params-file-attributes-lost-within-scheduler-defer/44107>\
**Category:** Product Support\
**Created:** [12 Mayo, 2016 08:51 UTC](https://meta.discourse.org/t/params-file-attributes-lost-within-scheduler-defer/44107 "2016-05-12T08:51:43Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![williamherry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/williamherry/32/104524_2.png) [@williamherry](https://meta.discourse.org/u/williamherry)\
**Post date:** [13 Mayo, 2016 02:45 UTC](https://meta.discourse.org/t/params-file-attributes-lost-within-scheduler-defer/44107/5 "2016-05-13T02:45:22Z")

</div>

I will post the info I get so far in case some one interested

Now I can narrow down the problem to: when use unicorn, object within `Scheduler::Defer.later` block will lost their instance\_variables

```
a = "1"
a.instance_variable_set('@a', 1)
Rails.logger.error(a.instance_values) # => {"a"=>1}
Scheduler::Defer.later("Create Upload") do
  Rails.logger.error(a.instance_values) # => nothing
end

```

If I start a console by `rails c` and run above code, the result is as expected,

after switch to thin, image upload works

unicorn also not work on my development machine, which is ubuntu, but the result is a little bit different: the instance\_varialbes remains, but the tempfile is show closed, call path on that return nil

```
{"tempfile"=>#<Tempfile: (closed)>, "original_filename"=>"favicons.png", "content_type"=>"image/png", "headers"=>"Content-Disposition: form-data; name=\"files[]\"; filename=\"favicons.png\"\r\nContent-Type: image/png\r\n"}

```

---

_[View the full topic](https://meta.discourse.org/t/params-file-attributes-lost-within-scheduler-defer/44107)._
