Skip to content

Commit 2e612db

Browse files
committed
feat(sample): 更新示例任务配置并增加 Dify 示例
- 修改 Ollama 示例任务的触发方式为手动触发 - 新增 Dify 示例任务,用于处理查询班级各学科前三名的问题 -优化 AIXxlJob 中的异常处理,提高错误日志的可
1 parent 1dae331 commit 2e612db

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

doc/db/tables_xxl_job.sql

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,22 @@ INSERT INTO `xxl_job_info`(`id`, `job_group`, `job_desc`, `add_time`, `update_ti
145145
`child_jobid`)
146146
VALUES (1, 1, '示例任务01', now(), now(), 'XXL', '', 'CRON', '0 0 0 * * ? *',
147147
'DO_NOTHING', 'FIRST', 'demoJobHandler', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化',
148-
'2018-11-03 22:21:31', ''),
149-
(2, 2, 'Ollama示例任务01', now(), now(), 'XXL', '', 'CRON', '0 0 0 * * ? *',
148+
now(), ''),
149+
(2, 2, 'Ollama示例任务01', now(), now(), 'XXL', '', 'NONE', '',
150150
'DO_NOTHING', 'FIRST', 'ollamaJobHandler', '{
151151
"input": "慢SQL问题分析思路",
152152
"prompt": "你是一个研发工程师,擅长解决技术类问题。"
153153
}', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化',
154-
'2018-11-03 22:21:31', '');
154+
now(), ''),
155+
(3, 2, 'Dify示例任务', now(), now(), 'XXL', '', 'NONE', '',
156+
'DO_NOTHING', 'FIRST', 'difyWorkflowJobHandler', '{
157+
"inputs":{
158+
"input":"查询班级各学科前三名"
159+
},
160+
"user": "xxl-job"
161+
}', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化',
162+
now(), '')
163+
;
155164

156165
INSERT INTO `xxl_job_user`(`id`, `username`, `password`, `role`, `permission`)
157166
VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 1, NULL);

xxl-job-executor-samples/xxl-job-executor-sample-springboot-ai/src/main/java/com/xxl/job/executor/jobhandler/AIXxlJob.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void ollamaJobHandler() throws Exception {
6464
return;
6565
}
6666
} catch (Exception e) {
67-
XxlJobHelper.log(e);
67+
XxlJobHelper.log(new RuntimeException("OllamaParam parse error", e));
6868
XxlJobHelper.handleFail();
6969
return;
7070
}
@@ -144,7 +144,7 @@ public void difyWorkflowJobHandler() throws Exception {
144144
difyParam.setUser("xxl-job");
145145
}
146146
} catch (Exception e) {
147-
XxlJobHelper.log(e);
147+
XxlJobHelper.log(new RuntimeException("DifyParam parse error", e));
148148
XxlJobHelper.handleFail();
149149
return;
150150
}

0 commit comments

Comments
 (0)