lib/inward.js
// then provide cached result, if any. Return true in this case.
then provide cached result, if any. Return true in this case.
then provide cached result if any . Return true in this case .
function inward_act_cache(ctxt, data) {
  var so = ctxt.options
  var meta = data.meta
  var actid = meta.id
  var private$ = ctxt.seneca.private$
  if (actid != null && so.history.active) {
    var actdetails = private$.history.get(actid)
    if (actdetails) {
      private$.stats.act.cache++
      var latest = actdetails.result[actdetails.result.length - 1] || {}
      var out = {
        kind: latest.err ? 'error' : 'result',
        result: latest.res || null,
        error: latest.err || null,
        log: {
          level: 'debug',
          data: {
            kind: 'act',
            case: 'CACHE',
            cachetime: latest.when
          }
        }
      }
      ctxt.cached$ = true
      return out
    }
  }
}
function inward_act_cache ( ctxt , data ) { var so = ctxt . options var meta = data . meta var actid = meta . id var private$ = ctxt . seneca . private$ if ( actid != null && so . history . active ) { var actdetails = private$ . history . get ( actid ) if ( actdetails ) { private$ . stats . act . cache ++ var latest = actdetails . result [ actdetails . result . length - 1 ] || { } var out = { kind : latest . err ? 'error' : 'result' , result : latest . res || null , error : latest . err || null , log : { level : 'debug' , data : { kind : 'act' , case : 'CACHE' , cachetime : latest . when } } } ctxt . cached$ = true return out } } }
then provide cached result, if any.
then provide cached result if any .