@Override
  public boolean updateHeartbeatWithRetry(Execution execution, Instant newHeartbeat, int tries) {

    try {
      return updateHeartbeat(execution, newHeartbeat);
    } catch (RuntimeException e) {
      if (tries <= 1) {
        LOG.warn("Failed to update heartbeat. No more retries.", e);
        return false;
      } else {
        LOG.info("Failed to update heartbeat. Remaining retries={}.", tries - 1, e);
        return updateHeartbeatWithRetry(execution, newHeartbeat, tries - 1);
      }
    }
  }
Instead of doing delete+insert, we allow updating an existing execution will all new fields

@return the execution-time of the new execution
db-scheduler/src/main/java/com/github/kagkarlsson/scheduler/jdbc/JdbcTaskRepository.java