-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Conversation
@@ -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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldCache
|
||
/// FIXME: better chunk size? | ||
file.cachedRead(at: fullPath, chunkSize: 2048).do { view in | ||
if cache { |
There was a problem hiding this comment.
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)
}
Fixes #87