mirror of
https://github.com/LamGC/Oracle-Sentry.git
synced 2025-07-02 21:37:27 +00:00
docs: 补充脚本编写文档.
This commit is contained in:
36
docs/cn/script/groovy/可用的触发器.md
Normal file
36
docs/cn/script/groovy/可用的触发器.md
Normal file
@ -0,0 +1,36 @@
|
||||
## 可用的触发器
|
||||
|
||||
### Once 触发器
|
||||
Once 触发器只会在启动后执行一次,适用于初始化等操作。
|
||||
|
||||
示例:
|
||||
```groovy
|
||||
trigger ("once") {
|
||||
run {
|
||||
// do something...
|
||||
}
|
||||
}
|
||||
```
|
||||
参数:
|
||||
- (没有参数)
|
||||
|
||||
`it` 对象:无
|
||||
|
||||
|
||||
### Timer 触发器
|
||||
Timer 触发器通过设定的 Cron 时间表达式,根据时间触发执行,可用于定时检查等操作。
|
||||
|
||||
示例:
|
||||
```groovy
|
||||
trigger ("once") {
|
||||
time "0 0 12 * * ? *"
|
||||
run {
|
||||
// do something...
|
||||
}
|
||||
}
|
||||
```
|
||||
参数:
|
||||
- `time`:Cron 时间表达式
|
||||
|
||||
`it` 对象:无
|
||||
|
Reference in New Issue
Block a user