Skip to content

Commit

Permalink
feat: 优化工作流日志记录逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
FHU-yezi committed Nov 11, 2024
1 parent 6bc9aff commit 3b8da07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion jobs/jianshu/article_earning_ranking.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
)


@retry(attempts=5, delay=10)
@retry(attempts=3, delay=5)
async def get_author_slug_and_info(
item: RecordField,
) -> tuple[Optional[str], Optional[UserInfo]]:
Expand Down
5 changes: 1 addition & 4 deletions utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ def get_flow_run_name() -> str:
return runtime.flow_run.name # type: ignore


def log_flow_run_start(logger: Logger) -> str:
def log_flow_run_start(logger: Logger) -> None:
logger.info(
"开始执行工作流",
flow_run_name=runtime.flow_run.name, # type: ignore
flow_name=runtime.flow_run.flow_name, # type: ignore
deployment_name=runtime.deployment.name, # type: ignore
)

# 返回流程运行名称,供后续日志使用
return get_flow_run_name() # type: ignore


def log_flow_run_success(logger: Logger, **kwargs: ExtraType) -> None:
logger.info(
Expand Down

0 comments on commit 3b8da07

Please sign in to comment.