feat(cache): Add force creation option for overwriting cache #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This pull request introduces the ability to force the creation of a cache even when an entry with the same video ID already exists. This feature ensures that developers or later implementations can overwrite outdated or incorrect cache objects with new video information, keeping the cache accurate and up to date.
Changes Made
Add New Option to Force Cache Creation
cacheOptions.force
parameter in theVInfoCache.createCache
function to enable forced creation and overwriting of an existing cache with the same video ID.createdDate
value.force
option.Add Test Case for Cache Overwrite Ability
cacheOptions.force
option successfully overwrites existing cache entries.createdDate
property is updated when an overwrite occurs.Updated Implementation
createCache
Impact
Summary
This feature introduces the
cacheOptions.force
option toVInfoCache.createCache
, allowing cache overwriting when necessary. Unit tests and API documentation updates have been included to ensure robustness and clarity.