ring

dbernal 2018-08-31T14:17:28.000100Z

has anyone ran into any issues when using lein ring and mount with swapped states? I'm having difficulty using lein ring's reload features. Whenever a file is changed it runs that respective file's tests during reload, calls mounts swaps, and subsequently removes the original mounted state. Is there a way to avoid this?

seancorfield 2018-08-31T15:32:43.000100Z

@dbernal That sounds like just a factor of how Mount works since it relies on global mutable state. It's why a lot of people prefer something like Component.

Dormo 2018-08-31T18:22:49.000100Z

Hello. I'm trying to implement file upload with a progress reporter. I am using ring.middleware.multipart-params https://ring-clojure.github.io/ring/ring.middleware.multipart-params.html Before the upload actually starts transferring data, I need to do some other stuff, namely give the upload an identifier, save that to a database, and add the identifier to the request so it can be included with the progress events dispatched to clients I am able to write my own :store function, where I have access to the java.io.InputStream, but I do not have access to the request I am able to write my own :progress-fn where I have access to the request, but I do not know how to add an upload-id to the request before it gets there

Dormo 2018-08-31T18:27:11.000100Z

I mean, if I can just add some arbitrary data to the request before it hits :progress-fn, that should be enough

Dormo 2018-08-31T20:27:15.000100Z

Before I wanted to add upload progress, I just made my route like this (POST "/room/:room-id/upload" req (upload/upload (add-upload-id req)))) and upload/upload would get the request and the uploaded file

Dormo 2018-08-31T20:27:27.000100Z

but not until after the upload was complete