seanyinx commented on a change in pull request #122: SCB-239 omega stateless
URL:
https://github.com/apache/incubator-servicecomb-saga/pull/122#discussion_r163732111
##########
File path:
alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/TxEvent.java
##########
@@ -64,21 +66,25 @@ public TxEvent(
String parentTxId,
String type,
String compensationMethod,
+ Date expireTime,
byte[] payloads) {
- this(-1L, serviceName, instanceId, creationTime, globalTxId, localTxId,
parentTxId, type, compensationMethod, payloads);
+ this(-1L, serviceName, instanceId, creationTime, globalTxId, localTxId,
parentTxId, type, compensationMethod,
+ expireTime, payloads);
}
- public TxEvent(
- long id,
+ TxEvent(Long surrogateId,
String serviceName,
String instanceId,
+ Date creationTime,
String globalTxId,
String localTxId,
String parentTxId,
String type,
String compensationMethod,
+ int timeout,
byte[] payloads) {
- this(id, serviceName, instanceId, new Date(), globalTxId, localTxId,
parentTxId, type, compensationMethod, payloads);
+ this(surrogateId, serviceName, instanceId, creationTime, globalTxId,
localTxId, parentTxId, type,
+ compensationMethod, timeout == 0 ? null : new
Date(creationTime.getTime() + timeout*1000), payloads);
Review comment:
yes, doing so can keep our logic simpler
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services