Closed DmitriyLewen closed 2 years ago
I think it might be a nice approach to refactor types.File
to instead hold a function which provides a reader to a file e.g. func() (io.Reader, error)
, instead of holding the raw []byte
slice itself. That way we only read files into memory when we need to process them. WDYT?
I did it at the beginning because that is why I asked you to add LazyMemoryFS. After some refactoring, I switched to []byte
for some reason. But it is worth trying it again. @liamg Could you take it over?
@DmitriyLewen Let me close this PR. Thanks.
Description
Fanal saves all json file from system as config files. If there are a lot of json files in the system, it can cause a lot of memory usage. Added skip json files without config type.