Currently, src/server/exec.js is relied upon to abstract away whether or not to shell out the tc commands from the profiles service. When in dev mode, require('/path/to/exec').exec( '...' ) is a NOP.
If we were to separate out the caching part of the profiles service from the tc part, define an interface and its null implementation, then we can safely remove the abstraction by composing these new services:
const profilesService = require('...')
const cachingProfilesService = require('...')
const nullProfilesService = require('...')
const profileService = cachingProfilesService( IS_PROD ? profilesService : nullProfilesService )
Currently,
src/server/exec.jsis relied upon to abstract away whether or not to shell out thetccommands from the profiles service. When in dev mode,require('/path/to/exec').exec( '...' )is a NOP.If we were to separate out the caching part of the profiles service from the
tcpart, define an interface and its null implementation, then we can safely remove the abstraction by composing these new services: