Update vc task timeout error message
This commit is contained in:
parent
c4155fb706
commit
7310c62e4d
@ -164,13 +164,13 @@ public class DefaultEntitiesVersionControlService implements EntitiesVersionCont
|
||||
var cacheEntry = taskCache.get(requestId);
|
||||
if (cacheEntry == null || cacheEntry.get() == null) {
|
||||
log.debug("[{}] No cache record: {}", requestId, cacheEntry);
|
||||
throw new ThingsboardException(ThingsboardErrorCode.ITEM_NOT_FOUND);
|
||||
throw new ThingsboardException("Task execution timed-out", ThingsboardErrorCode.ITEM_NOT_FOUND);
|
||||
} else {
|
||||
var entry = cacheEntry.get();
|
||||
log.trace("[{}] Cache get: {}", requestId, entry);
|
||||
var result = getter.apply(entry);
|
||||
if (result == null) {
|
||||
throw new ThingsboardException(ThingsboardErrorCode.BAD_REQUEST_PARAMS);
|
||||
throw new ThingsboardException("Invalid task", ThingsboardErrorCode.BAD_REQUEST_PARAMS);
|
||||
} else {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -668,7 +668,7 @@ public class VersionControlTest extends AbstractControllerTest {
|
||||
|
||||
private String createVersion(VersionCreateRequest request) throws Exception {
|
||||
UUID requestId = doPostAsync("/api/entities/vc/version", request, UUID.class, status().isOk());
|
||||
VersionCreationResult result = await().atMost(30, TimeUnit.SECONDS)
|
||||
VersionCreationResult result = await().atMost(60, TimeUnit.SECONDS)
|
||||
.until(() -> doGet("/api/entities/vc/version/" + requestId + "/status", VersionCreationResult.class), r -> {
|
||||
if (r.getError() != null) {
|
||||
throw new RuntimeException("Failed to create version '" + request.getVersionName() + "': " + r.getError());
|
||||
@ -701,7 +701,7 @@ public class VersionControlTest extends AbstractControllerTest {
|
||||
})));
|
||||
|
||||
UUID requestId = doPost("/api/entities/vc/entity", request, UUID.class);
|
||||
VersionLoadResult result = await().atMost(30, TimeUnit.SECONDS)
|
||||
VersionLoadResult result = await().atMost(60, TimeUnit.SECONDS)
|
||||
.until(() -> doGet("/api/entities/vc/entity/" + requestId + "/status", VersionLoadResult.class), VersionLoadResult::isDone);
|
||||
if (result.getError() != null) {
|
||||
throw new RuntimeException("Failed to load version: " + result);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user