onCall method

  1. @override
FutureOr<Object> onCall(
  1. Request request
)
override

Implementation

@override
FutureOr<Object> onCall(Request request) async {
  var stw = Stopwatch()..start();
  await component.onCall(request, period);
  stw..stop();
  if (request is! CronJobRequest &&
      component.resetPeriodOnExternalCall &&
      period is EveryX) {
    print("RESET PERIOD");
    (period as EveryX).reset();
  }
  return {
    "created": request.context.requestTime.toUtc().toString(),
    "took_ms": stw.elapsedMilliseconds,
    "path": request.fullPath
  };
}