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

Disable Leaf cache on development #88

Merged
merged 5 commits into from
Jan 9, 2018
Merged

Disable Leaf cache on development #88

merged 5 commits into from
Jan 9, 2018

Conversation

Joannis
Copy link
Member

@Joannis Joannis commented Jan 8, 2018

Fixes #87

@Joannis Joannis added the bug Something isn't working label Jan 8, 2018
@Joannis Joannis self-assigned this Jan 8, 2018
@@ -21,16 +22,21 @@ public final class LeafRenderer {
/// The event loop this leaf renderer will use
/// to read files and cache ASTs on.
let eventLoop: EventLoop

/// If `true`, caches leaf templates
let cache: Bool
Copy link
Member

Choose a reason for hiding this comment

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

shouldCache


/// Create a new Leaf renderer.
public init(
config: LeafConfig,
on worker: Worker
on worker: Worker,
caching: Bool = true
Copy link
Member

Choose a reason for hiding this comment

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

shouldCache

@tanner0101 tanner0101 merged commit b9aca84 into beta Jan 9, 2018
@tanner0101 tanner0101 deleted the leaf-cache branch January 9, 2018 18:40

/// FIXME: better chunk size?
file.cachedRead(at: fullPath, chunkSize: 2048).do { view in
if cache {

Choose a reason for hiding this comment

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

it should be

if cache {
    leafFile = file.cachedRead(at: fullPath, chunkSize: 2048)
} else {
    leafFile = file.read(at: fullPath, chunkSize: 2048)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants