Skip to content

Commit

Permalink
more log in variablerepo
Browse files Browse the repository at this point in the history
  • Loading branch information
kjozsa committed Apr 25, 2024
1 parent 39fdfb3 commit 577937e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ public interface VariableRepository extends CrudRepository<Variable, Long> {
default Variable saveIfFresh(Variable variable) {
Optional<Variable> existingVariable = findByWorkflowInstanceKeyAndName(variable.getWorkflowInstanceKey(), variable.getName());

if (existingVariable.isEmpty() || existingVariable.get().getTimestamp() < variable.getTimestamp()) {
if (existingVariable.isEmpty() || existingVariable.get().getTimestamp() <= variable.getTimestamp()) {
return save(variable);
} else {
logger.warn("not merging obsolete variable: {} for workflow instance: {}", variable.getName(), variable.getWorkflowInstanceKey());
logger.warn("not merging obsolete variable: {} for workflow instance: {} (old timestamp: {}, new timestamp: {})",
variable.getName(), variable.getWorkflowInstanceKey(), existingVariable.get().getTimestamp(), variable.getTimestamp());
return existingVariable.orElse(null);
}
}
Expand Down

0 comments on commit 577937e

Please sign in to comment.