setCache method
Stores a cache entry for the specified key.
Implementation
void setCache(String key, Cache cache) {
switch (cacheSource) {
case CacheSource.memory:
_cacheMemory[key] = cache;
break;
case CacheSource.file:
var file = File(
joinPaths([FinchApp.config.pathCache, "cache_$key.json"]),
);
file.createSync(recursive: true);
file.writeAsStringSync(cache.toJsonString());
break;
}
}