bugy / script-server

Web UI for your scripts with execution management
Other
1.52k stars 244 forks source link

(Optionally) avoid copying downloadable files? #679

Open floe opened 1 year ago

floe commented 1 year ago

Hi, thanks for writing script-server, quite useful!

I have a usecase where my script is generating rather large MP4 files, and every time I run it, all output files (including the ones from previous runs) get copied to a temp folder. This takes quite a bit of time and disk space, so I was wondering if there is a way to avoid the copy step? Maybe just soft-link them instead?

floe commented 1 year ago

(I'd also be fine with a pointer to the right spot in the code where I can patch this locally, but I haven't found it yet.)

bugy commented 1 year ago

Hi @floe unfortunately this is not possible to configure. I don't understand, though, why is it copying files from the previous runs. May be the search pattern finds them as well

You can check the following code here: https://github.com/bugy/script-server/blob/f0fc7cfe4de55eefe6e4a0939661948de198a63b/src/features/file_download_feature.py#L221 Soft links might work for you

floe commented 1 year ago

Thanks! I'll give it a try. (AFAICT just need to replace copyfile with os.link and that's it.)

floe commented 11 months ago

Thanks! I'll give it a try. (AFAICT just need to replace copyfile with os.link and that's it.)

Just for the record, I did exactly that and it works like a charm 👍

bugy commented 11 months ago

Great, thanks for the info!