Skip to content

Commit

Permalink
Bugfix node elapse time type error (TencentBlueKing#151)
Browse files Browse the repository at this point in the history
* bugfix: 修复在 get_task_status API 返回的 elapsed_time 为 Float 的问题

* docs: 版本号更新为 3.3.12

* minors: 节点开始时间与结束时间相等时不再做向上取整处理
  • Loading branch information
homholueng authored and pagezz-canway committed Apr 16, 2019
1 parent a13bb42 commit 3af7acc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ app_name: 标准运维
is_use_celery: True
author: 蓝鲸智云
introduction: 标准运维是通过一套成熟稳定的任务调度引擎,把在多系统间的工作整合到一个流程,助力运维实现跨系统调度自动化的SaaS应用。
version: 3.3.11
version: 3.3.12
category: 运维工具
language_support: 中文
desktop:
Expand Down
4 changes: 4 additions & 0 deletions docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,8 @@
# 3.3.11
- bug fix
- 修复在 API 中调用 ESB 获取用户信息异常的问题

# 3.3.12
- bug fix
- 修复在 get_task_status API 返回的 elapsed_time 为 Float 的问题

5 changes: 2 additions & 3 deletions pipeline/engine/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,12 @@ def calculate_elapsed_time(started_time, archived_time):
@return:
"""
if archived_time and started_time:
# when status_tree['archived_time'] == status_tree['started_time'], set elapsed_time to 1s
elapsed_time = (archived_time - started_time).total_seconds() or 1
elapsed_time = (archived_time - started_time).total_seconds()
elif started_time:
elapsed_time = (timezone.now() - started_time).total_seconds()
else:
elapsed_time = 0
return elapsed_time
return int(elapsed_time)


class ActionResult(object):
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
![](docs/resource/img/bk_sops.png)
---
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/Tencent/bk-sops/blob/master/LICENSE)
[![Release](https://img.shields.io/badge/release-3.3.11-brightgreen.svg)](https://github.com/Tencent/bk-sops/releases)
[![Release](https://img.shields.io/badge/release-3.3.12-brightgreen.svg)](https://github.com/Tencent/bk-sops/releases)
[![travis-ci](https://travis-ci.com/Tencent/bk-sops.svg?branch=master)](https://travis-ci.com/Tencent/bk-sops)
[![Coverage Status](https://codecov.io/gh/Tencent/bk-sops/branch/master/graph/badge.svg)](https://codecov.io/gh/Tencent/bk-sops)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/bk-sops/pulls)
Expand Down
2 changes: 1 addition & 1 deletion readme_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
![](docs/resource/img/bk_sops.png)
---
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/Tencent/bk-sops/blob/master/LICENSE)
[![Release](https://img.shields.io/badge/release-3.3.11-brightgreen.svg)](https://github.com/Tencent/bk-sops/releases)
[![Release](https://img.shields.io/badge/release-3.3.12-brightgreen.svg)](https://github.com/Tencent/bk-sops/releases)
[![travis-ci](https://travis-ci.com/Tencent/bk-sops.svg?branch=master)](https://travis-ci.com/Tencent/bk-sops)
[![Coverage Status](https://codecov.io/gh/Tencent/bk-sops/branch/master/graph/badge.svg)](https://codecov.io/gh/Tencent/bk-sops)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/bk-sops/pulls)
Expand Down

0 comments on commit 3af7acc

Please sign in to comment.