minor
This commit is contained in:
parent
cc6e65138e
commit
00139e31fe
|
@ -52,7 +52,8 @@ public class OpenaireInternalApiController extends AbstractDnetController {
|
|||
}
|
||||
}).start();
|
||||
} else {
|
||||
throw new RuntimeException("An import is already running");
|
||||
final long now = System.currentTimeMillis();
|
||||
return new ImportExecution(null, now, now, ImportStatus.NOT_LAUNCHED, "An other import is running");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -84,9 +85,19 @@ public class OpenaireInternalApiController extends AbstractDnetController {
|
|||
private String id;
|
||||
private Long dateStart;
|
||||
private Long dateEnd;
|
||||
private ImportStatus status = ImportStatus.NOT_LAUNCHED;
|
||||
private ImportStatus status = ImportStatus.NOT_YET_STARTED;
|
||||
private String message;
|
||||
|
||||
public ImportExecution() {}
|
||||
|
||||
public ImportExecution(final String id, final Long dateStart, final Long dateEnd, final ImportStatus status, final String message) {
|
||||
this.id = id;
|
||||
this.dateStart = dateStart;
|
||||
this.dateEnd = dateEnd;
|
||||
this.status = status;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
@ -163,5 +174,6 @@ enum ImportStatus {
|
|||
SUCCESS,
|
||||
FAILED,
|
||||
RUNNING,
|
||||
NOT_LAUNCHED
|
||||
NOT_LAUNCHED,
|
||||
NOT_YET_STARTED
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue