Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
熊鹏飞
/
xxljob220
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
38f89653
authored
Dec 25, 2017
by
xuxueli
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
脚本任务默认源码优化
parent
14d9d6a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl
xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl
View file @
38f89653
...
@@ -204,12 +204,15 @@ public class DemoGlueJobHandler extends IJobHandler {
...
@@ -204,12 +204,15 @@ public class DemoGlueJobHandler extends IJobHandler {
echo "xxl-job: hello shell"
echo "xxl-job: hello shell"
echo "脚本位置:$0"
echo "脚本位置:$0"
echo "参数数量:$#"
echo "任务参数:$1"
echo "分片序号 = $2"
echo "分片总数 = $3"
<
#
--echo
"参数数量:$#"
for
param
in
$*
for
param
in
$*
do
do
echo
"参数
:
$
param
"
echo
"参数
:
$
param
"
sleep
1s
sleep
1s
done
done
--
>
echo "Good bye!"
echo "Good bye!"
exit 0
exit 0
...
@@ -221,13 +224,18 @@ import time
...
@@ -221,13 +224,18 @@ import time
import sys
import sys
print "xxl-job: hello python"
print "xxl-job: hello python"
print "脚本文件:", sys.argv[0]
print "脚本文件:", sys.argv[0]
for i in range(1, len(sys.argv)):
print "任务参数:", sys.argv[1]
print "分片序号:", sys.argv[2]
print "分片总数:", sys.argv[3]
<
#
--for
i
in
range
(
1
,
len
(
sys
.
argv
))
:
time
.
sleep
(
1
)
time
.
sleep
(
1
)
print "参数", i, sys.argv[i]
print
"参数",
i
,
sys
.
argv
[
i
]
--
>
print "Good bye!"
print "Good bye!"
exit(0)
<
#
--
exit(0)
<
#
--
import
logging
import
logging
logging
.
basicConfig
(
level=
logging.DEBUG)
logging
.
basicConfig
(
level=
logging.DEBUG)
logging
.
info
("脚本文件:"
+
sys
.
argv
[
0
])
logging
.
info
("脚本文件:"
+
sys
.
argv
[
0
])
...
@@ -240,9 +248,12 @@ console.log("xxl-job: hello nodejs")
...
@@ -240,9 +248,12 @@ console.log("xxl-job: hello nodejs")
var arguments = process.argv
var arguments = process.argv
console.log("脚本文件: " + arguments[1])
console.log("脚本文件: " + arguments[1])
for (var i = 2; i
<
arguments
.
length
;
i
++){
console.log("任务参数: " + arguments[2])
console.log("分片序号: " + arguments[3])
console.log("分片总数: " + arguments[4])
<
#
--for
(
var
i =
2;
i
<
arguments
.
length
;
i
++){
console
.
log
("参数
%
s =
%s",
(
i-1
),
arguments
[
i
]);
console
.
log
("参数
%
s =
%s",
(
i-1
),
arguments
[
i
]);
}
}
--
>
console.log("Good bye!")
console.log("Good bye!")
process.exit(0)
process.exit(0)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment