Fork me on GitHub
#ring
<
2018-08-31
>
dbernal14:08:28

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?

seancorfield15:08:43

@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.

Dormo18:08:49

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

Dormo18:08:11

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

Dormo20:08:15

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

Dormo20:08:27

but not until after the upload was complete