Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions code/common/getter.q
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Bootstrap script that will enable an existing process to load in cache getter functionalities.

\d .getter

// Get cache from disk
getcachefromdisk:{[filePath] get hsym filePath}

// Get location of cache config and load it in.
cacheconfiglocation:.proc.getconfigfile["cacheconfig.json"];
cacheconfig:.j.k raze read0 hsym first cacheconfiglocation;

loadcaches:{
cachename:"MyFirstCache";
caches:key cacheconfig`componentCaches;
cachefilepaths: ` sv' ((hsym `$cacheconfig`cacheRootDir),2#`$cachename),/:`$(string caches),\:"/data";
cachesdata:getcachefromdisk each cachefilepaths;
cachevarnames:` sv' `.anycache.cache,/:caches;
cachevarnames set' cachesdata;
}

\d .