String.format("The lease time must not be negative. " +
"Specified lease time was %s seconds.",
formatLeaseTimeInSeconds(leaseMillis)));
}
TaskQueueModifyTaskLeaseRequest request = new TaskQueueModifyTaskLeaseRequest();
TaskQueueModifyTaskLeaseResponse response = new TaskQueueModifyTaskLeaseResponse();
request.setQueueName(this.queueName);
request.setTaskName(taskHandle.getName());
request.setLeaseSeconds(leaseMillis / 1000.0);
request.setEtaUsec(taskHandle.getEtaUsec());
apiHelper.makeSyncCall("ModifyTaskLease", request, response);
taskHandle.etaUsec(response.getUpdatedEtaUsec());
return taskHandle;
}