no message
This commit is contained in:
@@ -14,10 +14,13 @@ public:
|
||||
fprintf(ptr, "%s\n", text.getCharArray());
|
||||
}
|
||||
~File() {
|
||||
if (ptr != NULL) {
|
||||
fclose(ptr);
|
||||
ptr = NULL;
|
||||
}
|
||||
Close();
|
||||
}
|
||||
void Close(){
|
||||
if (ptr != NULL) {
|
||||
fclose(ptr);
|
||||
ptr = NULL;
|
||||
}
|
||||
}
|
||||
Text* readLines(){
|
||||
Text* lines = new Text();
|
||||
|
||||
@@ -20,12 +20,13 @@ public:
|
||||
virtual String getStatePrefix(){
|
||||
return String("Running");
|
||||
}
|
||||
/*
|
||||
virtual void Finalize(){
|
||||
this->state = Archivation;
|
||||
saveState();
|
||||
printf("Archivation started\n");
|
||||
Utils::ZipFolder(String("./"),String("archive.zip"));
|
||||
printf("Archivation ended\n");
|
||||
|
||||
}
|
||||
*/
|
||||
};
|
||||
@@ -84,6 +84,7 @@ public:
|
||||
case Execution:
|
||||
if (task->getState()==WorkspaceReady){
|
||||
activeCount++;
|
||||
task->start_time=Utils::getAbsoluteTime();
|
||||
task->Start();
|
||||
}else if (task->getState()==Running){
|
||||
activeCount++;
|
||||
|
||||
@@ -36,11 +36,13 @@ enum TestType{
|
||||
class Task {
|
||||
protected:
|
||||
long id;
|
||||
|
||||
int maxtime;
|
||||
int kernels; //получение зависит от типа задачи.
|
||||
String workspace;
|
||||
TaskState state;
|
||||
public:
|
||||
long start_time;
|
||||
String printState(){
|
||||
switch(state){
|
||||
case Inactive:
|
||||
@@ -146,6 +148,12 @@ public:
|
||||
//todo определить по интервалу времени на всякий случай.
|
||||
}else if (Utils::Exists(workspace+"/INTERRUPT")){
|
||||
state=AbortedByUser;
|
||||
} else {
|
||||
long now = Utils::getAbsoluteTime();
|
||||
long delta = now-start_time;
|
||||
if (maxtime<delta){
|
||||
state=AbortedByTimeout;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (state!=Running){
|
||||
|
||||
Reference in New Issue
Block a user