com.netflix.spinnaker.orca.pipeline.model.Execution.isCanceled()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(111)

本文整理了Java中com.netflix.spinnaker.orca.pipeline.model.Execution.isCanceled()方法的一些代码示例,展示了Execution.isCanceled()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Execution.isCanceled()方法的具体详情如下:
包路径:com.netflix.spinnaker.orca.pipeline.model.Execution
类名称:Execution
方法名:isCanceled

Execution.isCanceled介绍

暂无

代码示例

代码示例来源:origin: com.netflix.spinnaker.orca/orca-front50

@Override
 public CancellableStage.Result cancel(Stage stage) {
  String readableStageDetails = format("(stageId: %s, executionId: %s, context: %s)", stage.getId(), stage.getExecution().getId(), stage.getContext());
  log.info(format("Cancelling stage %s", readableStageDetails));

  try {
   String executionId = (String) stage.getContext().get("executionId");
   if (executionId != null) {
    if (executionRepository == null) {
     log.error(format("Stage %s could not be canceled w/o front50 enabled. Please set 'front50.enabled: true' in your orca config.", readableStageDetails));
    } else {
     Execution childPipeline = executionRepository.retrieve(PIPELINE, executionId);
     if (!childPipeline.isCanceled()) {
      // flag the child pipeline as canceled (actual cancellation will happen asynchronously)
      executionRepository.cancel(stage.getExecution().getType(), executionId, "parent pipeline", null);
     }
    }
   }
  } catch (Exception e) {
   log.error(format("Failed to cancel stage %s, e: %s", readableStageDetails, e.getMessage()), e);
  }

  return new CancellableStage.Result(stage, emptyMap());
 }
}

代码示例来源:origin: com.netflix.spinnaker.orca/orca-redis

try {
 map.put("application", execution.getApplication());
 map.put("canceled", String.valueOf(execution.isCanceled()));
 map.put("limitConcurrent", String.valueOf(execution.isLimitConcurrent()));
 map.put("buildTime", String.valueOf(execution.getBuildTime() != null ? execution.getBuildTime() : 0L));

相关文章