Skip to content

Commit

Permalink
2.4.5 workflow need-job
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaobaidadada committed Feb 3, 2025
1 parent e5a85e6 commit ada19da
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "filecat",
"version": "2.4.4",
"version": "2.4.5",
"description": "filecat 文件管理器",
"author": "xiaobaidadada",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/common/req/file.req.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export interface job_item {
key: string; // 是job的key属性
cwd: string;
name: string;
need_job: string | undefined;
"need-job": string | undefined;
steps: step_item[];
repl?:boolean;

Expand Down
2 changes: 1 addition & 1 deletion src/main/domain/file/workflow/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
cwd: E:\test # 需要一个实际的执行目录 默认是当前的yml所在目录 目录内的文件清理需要自己使用命令操作 必须是绝对路径
name: 第一阶段执行
repl: false # 交互式运行 当上一个step 运行没有结束 有输出的时候 就执行下一个 step 默认是 false 必须要自己设置好流程 避免出现一直等待 那么只能手动关闭了
# need_job: build-job2 # 需要别的job先完成 只能是本文件内的
# need-job: build-job2 # 需要别的job先完成 只能是本文件内的
steps: # 这些脚本会按顺序执行
- use-yml: test2 # 使用其它 yml 文件中的 name
with-env:
Expand Down
12 changes: 6 additions & 6 deletions src/main/domain/file/workflow/workflow.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class work_children {


done_jobs = new Set<string>();
need_job_map:Map<string,string> = new Map(); // 对方的key 自己的key job.need_job,job.key
need_job_map:Map<string,string> = new Map(); // 对方的key 自己的key job['need-job'],job.key

all_job_resolve;

Expand Down Expand Up @@ -291,15 +291,15 @@ class work_children {
return;
}
// 某些 是否需要其它job执行完成 提前做个map
if (job.need_job) {
if(!this.jobs_map.has(job.need_job)) {
if (job['need-job']) {
if(!this.jobs_map.has(job['need-job'])) {
// 需要的job不存在
this.done_fail_job_handle(job,`job not found ${job.need_job}`);
this.done_fail_job_handle(job,`job not found ${job['need-job']}`);
return;
}
if (!this.done_jobs.has(job.need_job)) {
if (!this.done_jobs.has(job['need-job'])) {
// need没有完成
this.need_job_map.set(job.need_job,job.key);
this.need_job_map.set(job['need-job'],job.key);
// 检测循环依赖
let v = this.need_job_map.get(job.key); // 自己是否被依赖
const start_v = v;
Expand Down
2 changes: 1 addition & 1 deletion src/web/project/component/prompts/FileNew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
cwd: E:\\test # 需要一个实际的执行目录 默认是当前的yml所在目录 目录内的文件清理需要自己使用命令操作 必须是绝对路径
name: 第一阶段执行
repl: false # 交互式运行 当上一个step 运行没有结束 有输出的时候 就执行下一个 step 默认是 false 必须要自己设置好流程 避免出现一直等待 那么只能手动关闭了
# need_job: build-job2 # 需要别的job先完成 只能是本文件内的
# need-job: build-job2 # 需要别的job先完成 只能是本文件内的
steps: # 这些脚本会按顺序执行
- use-yml: test2 # 使用其它 yml 文件中的 name
with-env:
Expand Down

0 comments on commit ada19da

Please sign in to comment.