-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vapor fix - Delete temp file via queued closure instead of app terminating #153
Vapor fix - Delete temp file via queued closure instead of app terminating #153
Conversation
Hey thanks for your PR, There's already handling for files on remote disk, perhaps you can have a look over there why it doesn't work correctly; |
Thanks, I see what you mean. It's a bit hard to debug because it only happens on Vapor. I'll see if I can have a look what is happening. |
I can confirm the I have not found a solution for this yet that works with Vapor (other than using a job or cron). |
With the help of the Serverless Laravel slack I came up with a solution to delete the file after the request on Vapor. It uses a queued closure. The PR is updated to reflect the new change. Ideally we could check if it's running on Vapor, then use the queued closure, otherwise (on non Vapor) use If you want I can add this to the PR, let me know @patrickbrouwers |
@SanderMuller what happens when you don't use queuing? (Even though it's probably safe to assume people using remote disks are probably also using queuing) |
@patrickbrouwers You're right, with sync as queue driver it deletes the file before serving it. A solution could be to do both: app terminate and a queued closure. Not the prettiest code, tho. |
But you mentioned terminating didn't work with Vapor? |
Terminating happens immediately on Vapor. So on Vapor it would immediately dispatch the job, which is fine. On non-Vapor with sync queue driver it would on terminate dispatch the job which is executed immediately (but after terminating) |
Okay that sounds pretty good then, I'm out of office until Monday, will check it when I'm back! |
…Sync queue driver
Perfect, I've updated the PR with the combination of app terminating and the queued closure as we discussed |
Let me know what you think. |
This is a much needed feature (bug fix ?), @patrickbrouwers any update regarding the review? Thanks :) |
@patrickbrouwers we are also still experiencing this issue on our live environment, could you have a look at it? |
@patrickbrouwers would appreciate if you could take a look |
@FrankPeters could assist in getting this PR reviewed/merged so we can export in Nova again on our live environment? |
Sorry haven't had any time for open source the last few months. I can't promise anything, but will try to squeeze in some time next week. Until then, you can always deploy your own fork. |
@SanderMuller @patrickbrouwers This is still a problem for me. Is there a solution for it, or should i just use the fork that SanderMuller referenced above? |
We still use the fork ourselves |
This fix was merged right? What else is missing in the latest release that's on your fork? |
@patrickbrouwers I just don't think a tag has been made with these changes now that i look at 1.3.2 |
I tagged a new release |
@patrickbrouwers Legend. Thank you very much |
@patrickbrouwers - hmm it doesn't seem like the change is in there - 1.3.8...1.3.10 I think i was looking at SanderMullers fork instead of this one #183 i've made this one based on their fork |
Exports in Laravel Nova on Vapor are giving a
Illuminate\Contracts\Filesystem\FileNotFoundException
while working locally.Exception message:
This PR lets the disk handle the creation of the temporary URL to download the file when a remote disk is configured.
Without this change, it seems that it will try and download the local file instead of the remote file.