Remove task.getKey()
This commit is contained in:
parent
5993b8b963
commit
1e5b6cc9a9
@ -36,11 +36,6 @@ public class DummyTask extends Task<DummyTaskResult> {
|
|||||||
private List<String> errors; // errors for each attempt
|
private List<String> errors; // errors for each attempt
|
||||||
private boolean failAlways;
|
private boolean failAlways;
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object getKey() {
|
|
||||||
return number;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DummyTaskResult toFailed(Throwable error) {
|
public DummyTaskResult toFailed(Throwable error) {
|
||||||
return DummyTaskResult.failed(this, error);
|
return DummyTaskResult.failed(this, error);
|
||||||
|
|||||||
@ -15,7 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.thingsboard.server.common.data.job.task;
|
package org.thingsboard.server.common.data.job.task;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||||
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
|
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
|
||||||
@ -46,9 +45,6 @@ public abstract class Task<R extends TaskResult> {
|
|||||||
|
|
||||||
private int attempt = 0;
|
private int attempt = 0;
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public abstract Object getKey();
|
|
||||||
|
|
||||||
public abstract R toFailed(Throwable error);
|
public abstract R toFailed(Throwable error);
|
||||||
|
|
||||||
public abstract R toDiscarded();
|
public abstract R toDiscarded();
|
||||||
|
|||||||
@ -115,11 +115,11 @@ public abstract class TaskProcessor<T extends Task<R>, R extends TaskResult> {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
T task = (T) JacksonUtil.fromString(msg.getValue().getValue(), Task.class);
|
T task = (T) JacksonUtil.fromString(msg.getValue().getValue(), Task.class);
|
||||||
if (discardedJobs.contains(task.getJobId().getId())) {
|
if (discardedJobs.contains(task.getJobId().getId())) {
|
||||||
log.info("Skipping task '{}' for cancelled job {}", task.getKey(), task.getJobId());
|
log.debug("Skipping task for cancelled job {}: {}", task.getJobId(), task);
|
||||||
reportTaskDiscarded(task);
|
reportTaskDiscarded(task);
|
||||||
continue;
|
continue;
|
||||||
} else if (deletedTenants.contains(task.getTenantId().getId())) {
|
} else if (deletedTenants.contains(task.getTenantId().getId())) {
|
||||||
log.info("Skipping task '{}' for deleted tenant {}", task.getKey(), task.getTenantId());
|
log.debug("Skipping task for deleted tenant {}: {}", task.getTenantId(), task);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
processTask(task);
|
processTask(task);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user