Skip to content
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

feat: CacheFS improvement - Folder support #22

Merged
merged 5 commits into from Sep 11, 2023

Conversation

john-george
Copy link
Contributor

@john-george john-george commented Sep 5, 2023

What did you implement:

Ability to instantiate CacheFS for a specific folder, to allow purging of cached files beyond just deleting individual files by key.

How did you implement it:

For example:

' @import /components/CacheFS.brs from @dazn/kopytko-utils
' @import /components/ternary.brs from @dazn/kopytko-utils
' @import /components/http/cache/CachedHttpResponse.brs
function HttpCache() as Object
  prototype = {}

  prototype._cacheFS = CacheFS("httpCache")

  ...

in https://github.com/getndazn/kopytko-framework/blob/master/src/components/http/cache/HttpCache.brs would allow us to purge all http related cache via a new method like so:

  ' @returns {Boolean} - true if cache in context has been purged
  prototype.clear = sub () as Boolean
    return m._cacheFS.clear()
  end sub

How can we verify it:

Todos:

  • Write documentation (if required)
  • Write new unit tests
  • Fix linting errors
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

@john-george john-george marked this pull request as ready for review September 6, 2023 15:46
@john-george john-george requested a review from a team as a code owner September 6, 2023 15:46
@john-george john-george requested review from bchelkowski and adamczopek and removed request for a team September 6, 2023 15:46
Copy link
Contributor

@pawelhertman pawelhertman left a comment

Choose a reason for hiding this comment

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

Great job! Please add "feat:" prefix to the PR's title

src/components/CacheFS.brs Outdated Show resolved Hide resolved
src/components/CacheFS.brs Outdated Show resolved Hide resolved
src/components/CacheFS.brs Outdated Show resolved Hide resolved
src/components/CacheFS.brs Outdated Show resolved Hide resolved
@john-george john-george changed the title CacheFS improvement: Directory support feat: CacheFS improvement - Folder support Sep 7, 2023
@john-george
Copy link
Contributor Author

@pawelhertman, thanks for the feedback! they have been addressed in ac3c166 (#22)

(did you check if createDirectory can create nested folders?)

checked and confirmed that a directory path notation is supported only if a parent folder exists for each level of nested folder.

@bchelkowski bchelkowski merged commit 9181333 into getndazn:master Sep 11, 2023
github-actions bot pushed a commit that referenced this pull request Sep 11, 2023
# [2.4.0](v2.3.2...v2.4.0) (2023-09-11)

### Features

* CacheFS improvement - Folder support ([#22](#22)) ([9181333](9181333))
@github-actions
Copy link

🎉 This PR is included in version 2.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants