Fix cache value serialization issue
This commit is contained in:
parent
3e7086cc6f
commit
48c3ce7047
@ -174,9 +174,11 @@ public class DefaultEntitiesVersionControlService implements EntitiesVersionCont
|
||||
private <T> T getStatus(SecurityUser user, UUID requestId, Function<VersionControlTaskCacheEntry, T> getter) throws ThingsboardException {
|
||||
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);
|
||||
} else {
|
||||
var entry = cacheEntry.get();
|
||||
log.debug("[{}] Cache get: {}", requestId, entry);
|
||||
var result = getter.apply(entry);
|
||||
if (result == null) {
|
||||
throw new ThingsboardException(ThingsboardErrorCode.BAD_REQUEST_PARAMS);
|
||||
|
||||
@ -17,8 +17,10 @@ package org.thingsboard.server.cache;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import org.springframework.cache.Cache;
|
||||
|
||||
@ToString
|
||||
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class SimpleTbCacheValueWrapper<T> implements TbCacheValueWrapper<T> {
|
||||
|
||||
|
||||
@ -20,12 +20,15 @@ import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import org.thingsboard.server.common.data.id.EntityId;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class EntityLoadError {
|
||||
public class EntityLoadError implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 7538450180582109391L;
|
||||
|
||||
private String type;
|
||||
private EntityId source;
|
||||
|
||||
@ -21,11 +21,15 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.thingsboard.server.common.data.EntityType;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class EntityTypeLoadResult {
|
||||
public class EntityTypeLoadResult implements Serializable {
|
||||
private static final long serialVersionUID = -8428039809651395241L;
|
||||
|
||||
private EntityType entityType;
|
||||
private int created;
|
||||
private int updated;
|
||||
|
||||
8
docker/.gitignore
vendored
8
docker/.gitignore
vendored
@ -6,4 +6,12 @@ tb-node/postgres/**
|
||||
tb-node/cassandra/**
|
||||
tb-transports/*/log
|
||||
tb-vc-executor/log/**
|
||||
tb-node/redis-cluster-data-0/**
|
||||
tb-node/redis-cluster-data-1/**
|
||||
tb-node/redis-cluster-data-2/**
|
||||
tb-node/redis-cluster-data-3/**
|
||||
tb-node/redis-cluster-data-4/**
|
||||
tb-node/redis-cluster-data-5/**
|
||||
tb-node/redis-data/**
|
||||
|
||||
!.env
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user