adapt-security / adapt-authoring-adaptframework

Adapt framework integration for the Adapt authoring tool
0 stars 1 forks source link

Add support for build caching #39

Open taylortom opened 5 months ago

taylortom commented 5 months ago

The framework's build cache is currently broken and therefore has been disabled.


Currently the adapt-cli uses the OS temp folder to store the cache path. This can result in EPERM errors when running multiple instances under different users on the same server (as cache dir is created & owned by the first user to build a course).

Implementation notes

cacheManager.cachePath( 
cwd, options.out, buildConfig.cachepath);
cachePath(basePath, outputFilePath = process.cwd(), configuredCachePath) {
   const projectHash = CacheManager.hash(path.join(basePath, outputFilePath));
   const cachePath = path.join(configuredCachePath || this.tempPath, `${projectHash}.cache`);
   return cachePath;
  }
taylortom commented 5 months ago

This should be fixed. Needs to be tested on infrastructure which is suitably restrictive