Closed ivan-kolesov closed 2 years ago
You can use JobListener and react based on different events
You can use JobListener and react based on different events
Tried to play with JobListener, but can't get nextRunSchedule that handles SqOperation only.
What does nextRunSchedule means ?
nextRunSchedule
This means when the next time job will start based on scheduled time. Because retry delay might be linear or exponential and no any way to determine the delay inside a job.
If you want the info in the internal logger I think we can add it.
Otherwise I suggest you implement your custom Retry Constraint using
JobBuilder(type: type)
.add(constraint: MyCustomRetryConstraint())
.schedule(manager: manager)
If your job require serialisation make sure your MyCustomRetryConstraint
implement CodableConstraint
. And in your deserialiser you need to inject the MyCustomRetryConstraint
inside the constraint factory from DecodableSerializer
DecodableSerializer(maker: MyCustomConstraintMaker())
Thanks, I want to see the info not in internal logger, but somewhere as you offered, in JobListener. If I implement a custom constraint will the constraint persist in the storage where job saves?
Yes if your custom constraint extends CodableConstraint. Also you will need a custom ConstraintMaker to re-add the custom constraint when deserialiser.
All internal constraints Are also created using this mechanism
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Retry Constraint is marked as final, and it's not a good idea cloning the constraint for modifying a few lines
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is it possible to get additional information about a running task: scheduled start time, number of iterations, task status (pending, running, completed)? If it were possible to obtain an instance of SqOperation publicly, then this question would not exist.