Skip to content

Conversation

sbleon
Copy link
Member

@sbleon sbleon commented Sep 22, 2025

  • Throw an error if misconfigured instead of logging. Also remove a maybe-lying comment.
  • Replace the cache file after scanning for objects instead of blowing it away first thing

…it away first thing

This should make resets interfere less with other concurrent requests
@sbleon sbleon marked this pull request as ready for review September 22, 2025 17:08
@sbleon sbleon requested a review from Rodel30 September 22, 2025 17:08
@sbleon sbleon changed the title leon adjust cache behavior Adjust cache behavior for smoother rebuilding Sep 22, 2025
Copy link
Member

@Rodel30 Rodel30 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, just one little thing I think should be different 🙃

<cfset this.scanForObjects()>

<cfif arguments.useCacheFile>
<cfif arguments.useCacheFile or arguments.deleteCacheFile>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I think the use case likely doesn't really exist, given the names of the arguments I think it may be better to have this as:

<cfif arguments.useCacheFile>
//Writing the cache file, as is currently happening
<cfelseif arguments.deleteCacheFile>
//delete the cache file without writing a new one, effectively moving the delete command that used to be up top down here
<cfelse>
//do nothing, as is currently happening

This preserves the previous effective functionality, while still having the benefit of not having a missing cache file while the new copy is being constructed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm intentionally changing the meaning of deleteCacheFile to be "replace cache file". Of the few known apps (2?) that use this library, I don't think there are any use cases that would just want to delete file and not replace it.

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.

2 participants