1 Star 0 Fork 0

sqos/beats

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
.github
dev-tools
filebeat
generate
heartbeat
libbeat
metricbeat
packetbeat
scripts
testing/environments
vendor
winlogbeat
_meta
beater
checkpoint
config
docs
eventlog
bench_test.go
cache.go
doc.go
eventlog.go
eventlogging.go
eventlogging_test.go
factory.go
retry.go
wineventlog.go
wineventlog_test.go
sys
tests/system
.gitignore
Makefile
README.md
main.go
main_test.go
make.bat
winlogbeat.full.yml
winlogbeat.template-es2x.json
winlogbeat.template.json
winlogbeat.yml
.appveyor.yml
.editorconfig
.gitattributes
.gitignore
.travis.yml
CHANGELOG.asciidoc
CONTRIBUTING.md
Dockerfile
LICENSE
Makefile
NOTICE
README.md
Vagrantfile
codecov.yml
glide.yaml
克隆/下载
retry.go 666 Bytes
一键复制 编辑 原始数据 按行查看 历史
package eventlog
// retry invokes the retriable function. If the retriable function returns an
// error then the corrective action function is invoked and passed the error.
// The correctiveAction function should attempt to correct the error so that
// retriable can be invoked again.
func retry(retriable func() error, correctiveAction func(error) error) error {
err := retriable()
if err != nil {
caErr := correctiveAction(err)
if caErr != nil {
// Something went wrong, return original error.
return err
}
retryErr := retriable()
if retryErr != nil {
// The second attempt failed, return original error.
return err
}
}
return nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sqos/beats.git
git@gitee.com:sqos/beats.git
sqos
beats
beats
v5.2.2

搜索帮助