run_timeout
This commit is contained in:
parent
e74c692fe6
commit
b9d2040a2c
12
src/main.cpp
12
src/main.cpp
@ -143,10 +143,10 @@ int main(int argc, char* argv[]) {
|
||||
std::filesystem::create_directory(buildDir);
|
||||
}
|
||||
LOG("getting run time out")
|
||||
int runtimeout = 0;
|
||||
if(jsonValue["runtimeout"]!=Json::nullValue){
|
||||
runtimeout = jsonValue["runtimeout"].asInt();
|
||||
printValue(runtimeout)
|
||||
int run_timeout = 0;
|
||||
if(jsonValue["run_timeout"]!=Json::nullValue){
|
||||
run_timeout = jsonValue["run_timeout"].asInt();
|
||||
printValue(run_timeout)
|
||||
}
|
||||
LOG("compiling")
|
||||
string compileCommands;
|
||||
@ -219,8 +219,8 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
vector<ProgramRet> results(jsonTests.size()+1);
|
||||
for(auto &i:futures){
|
||||
if(runtimeout>0){
|
||||
if(i.wait_for(std::chrono::milliseconds(runtimeout))==std::future_status::ready){
|
||||
if(run_timeout>0){
|
||||
if(i.wait_for(std::chrono::milliseconds(run_timeout))==std::future_status::ready){
|
||||
auto ret = i.get();
|
||||
results[ret.id]=ret;
|
||||
}
|
||||
|
@ -15,5 +15,5 @@
|
||||
"ans":"2.ans"
|
||||
}
|
||||
],
|
||||
"runtimeout":100
|
||||
"run_timeout":100
|
||||
}
|
Loading…
Reference in New Issue
Block a user