Skip to content

Support file copying on forbidden#23

Closed
CodeingBoy wants to merge 4 commits intomaple3142:masterfrom
CodeingBoy:copy_upstream
Closed

Support file copying on forbidden#23
CodeingBoy wants to merge 4 commits intomaple3142:masterfrom
CodeingBoy:copy_upstream

Conversation

@CodeingBoy
Copy link
Contributor

Clean version of #21.

@MythodeaLoL
Copy link

Can you add an option to automatically delete the copied files after 1 day of existence? or something that prevents the user from having to delete manually. That would be very useful.

Thanks for the update @CodeingBoy ☕️

@CodeingBoy
Copy link
Contributor Author

Can you add an option to automatically delete the copied files after 1 day of existence? or something that prevents the user from having to delete manually. That would be very useful.

Thanks for the update @CodeingBoy

No, because the worker is stateless. Due to worker limitation, I can't record create time in worker, or run auto deletion periodically.

Quick ideas:

  1. record create time in KV and provide a button allowing user manually delete those obsoleted files
  2. (If we can) listen for ending of request and delete it

I will add this to my to-do list but this will not be the next feature I will implement.

@maple3142
Copy link
Owner

@CodeingBoy For 1, I don't think it should be used, as I want to avoid KV. (Because it needs subscription.)
For 2, I don't think it is possible, because worker has limited execution time and memory, so you can't download the whole file body and send it to client.

But I wonder what happens if you delete the file right after you start the download.

@CodeingBoy
Copy link
Contributor Author

@CodeingBoy For 1, I don't think it should be used, as I want to avoid KV. (Because it needs subscription.)
For 2, I don't think it is possible, because worker has limited execution time and memory, so you can't download the whole file body and send it to client.

That's why we need more thinking.

But I wonder what happens if you delete the file right after you start the download.

That's a good idea, though I don't know what will happen. Also this will cause more copy request, Google won't happy with that.

@CodeingBoy CodeingBoy closed this Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants