Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么脚本时间会限制最长一天? #1950

Closed
rayn316 opened this issue May 14, 2024 · 10 comments
Closed

为什么脚本时间会限制最长一天? #1950

rayn316 opened this issue May 14, 2024 · 10 comments

Comments

@rayn316
Copy link
Contributor

rayn316 commented May 14, 2024

What would you like to be added:
为什么脚本时间会限制最长一天?
某些任务需要传输大文件,最大5天的时间
在创建任务时会提示不能超过1天的超时设置,为什么会有这个限制呢?

Why is this needed:

@UlricQin
Copy link
Member

告警自愈的场景是短周期任务。你要传文件,用p2p之类的工具更合适

@rayn316
Copy link
Contributor Author

rayn316 commented May 14, 2024

如果更改代码现在后编译运行,长时间运行对categraf没有关系吧?
比如过categraf也有运行时间限制之类的

@UlricQin
Copy link
Member

需要实测

@rayn316
Copy link
Contributor Author

rayn316 commented May 14, 2024

在更改文件 models/task_tpl.go 中 函数Verify和CleanFields
判断时间改为

        if t.Timeout > 36000*24 {
                return errors.New("arg(timeout) longer than one day")
        }

编译后运行,创建脚本是可以设置超时超过1天的时间,但是在使用脚本执行任务或直接创建任务时还是会弹出提示 arg(timeout) longer than one day
请问这种情况还应该更改哪些地方?

@UlricQin
Copy link
Member

UlricQin commented May 14, 2024 via email

@rayn316
Copy link
Contributor Author

rayn316 commented May 14, 2024

就这2个地方,除了这个没改pkg/i18nx/var.go,其他都改了,不行才问的
前端代码和categraf也搜索了,没有这个错误
image

@UlricQin
Copy link
Member

你可以修改“arg(timeout) longer than one day” 为 “arg(timeout) longer than one day 2222” 看看报错里是否出来这个 2222,如果没有,那就是改的地方不对。

所有代码在两个仓库:ccfos/nightingale flashcatcloud/ibex 如果搜不到,我也帮不了你了

@rayn316
Copy link
Contributor Author

rayn316 commented May 16, 2024

修改ibex超时后可以,运行任务可以超过1天的时间
我可以将代码合并到这里吗,将超时时间设置为5天限制?

@UlricQin
Copy link
Member

可以

@rayn316
Copy link
Contributor Author

rayn316 commented May 21, 2024

ok

@rayn316 rayn316 closed this as completed May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants