Skip to content

Commit

Permalink
Lock user-tasks for 100 years instead of 24.83 days
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanpelikan committed Dec 12, 2024
1 parent 2c71e34 commit af60685
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@
public class Camunda8TaskWiring extends TaskWiringBase<Camunda8Connectable, Camunda8ProcessService<?>, Camunda8MethodParameterFactory>
implements Consumer<ZeebeClient> {

/*
* timeout can be set to Long.MAX_VALUE but this will cause a subsequent error
* (see https://github.com/camunda/camunda/issues/11903). Therefor the timeout
* is set to 100 years.
*/
private static final long TIMEOUT_100YEARS = 100L * 365 * 24 * 3600 * 1000;

private final String workerId;

private final SpringDataUtil springDataUtil;
Expand Down Expand Up @@ -112,7 +119,7 @@ public void openWorkers() {
.newWorker()
.jobType("io.camunda.zeebe:userTask")
.handler(userTaskHandler)
.timeout(Long.MAX_VALUE) // user-tasks are not fetched more than once
.timeout(TIMEOUT_100YEARS) // user-tasks should not be fetched more than once
.name(workerId);

if (tenantId != null) {
Expand Down

0 comments on commit af60685

Please sign in to comment.