8000 Added thumbnail caching by sbs20 · Pull Request #635 · sbs20/scanservjs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Added thumbnail caching #635

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

Merged
merged 1 commit into from
Sep 25, 2023
Merged

Added thumbnail caching #635

merged 1 commit into from
Sep 25, 2023

Conversation

sbs20
Copy link
Owner
@sbs20 sbs20 commented Sep 25, 2023

This pull request adds thumbnail caching, which is very much needed for low power devices such as the raspberry pi.

The thumbnail is generated only when requested and will be deleted when the file is deleted.

Closes #433
Builds on original implementation in #592

This pull request adds thumbnail caching, which is very much needed for low power devices such as the raspberry pi.

The thumbnail is generated only when
8000
 requested and will be deleted when the file is deleted.

Contributes to #433
@sbs20 sbs20 self-assigned this Sep 25, 2023
@sbs20 sbs20 merged commit 0ef33f4 into master Sep 25, 2023
@sbs20 sbs20 deleted the iss433 branch September 25, 2023 15:13
@Leone25
Copy link
Leone25 commented Nov 14, 2023

Hey sorry to bother, but I just noticed two main differences between your version and my version:

  1. you are saving before sending the thumbnail (if the thumbnail isn't yet generated)
  2. you are using a sync write/read when writing/reading the thumbnail

I had made the async versions of those two commands especially because I didn't want to block the main thread when doing those operations, why did you switch back? I'm just curious

@sbs20
Copy link
Owner Author
sbs20 commented Nov 14, 2023

Hello!

Not a bother 😄

  1. Yes, I suppose it's slightly different. I wanted to avoid mixing .then(...) and await. I didn't feel strongly about the order
  2. It would be better not to block the main thread, you're correct. But I was in the middle of a fairly massive refactoring and wanted to keep the number of paths through the application at an absolute minimum. I prioritised re-using code which was already there and working over non-blocking. I do intend to remove all the sync methods, but wanted to get everything else out of the way first.

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.

Thumbnail generation on the fly very expensive
2 participants
0