runTaskPostRun function

Future<void> runTaskPostRun(
  1. TaskResult taskResult
)

Implementation

Future<void> runTaskPostRun(TaskResult taskResult) async {
  final task = taskResult.invocation.task;
  var isError = false;
  logger.fine("Running post-run action for task '${task.name}'");
  final stopwatch = Stopwatch()..start();
  try {
    await task.runCondition.postRun(taskResult);
    stopwatch.stop();
  } on Exception {
    stopwatch.stop();
    isError = true;
    rethrow;
  } finally {
    logger.log(
        profile,
        "Post-run action of task '${task.name}' completed "
        "${!isError ? 'successfully' : 'with errors'}"
        ' in ${elapsedTime(stopwatch)}');
  }
}