eric-lee-ltk commented on a change in pull request #122: SCB-239 omega stateless
URL:
https://github.com/apache/incubator-servicecomb-saga/pull/122#discussion_r163479263
##########
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:
the timeout is in second while the getTime is in milliseconds, that's why we
multiply by 1000. You mean we should prefer to set the expireTime to be
9999-12-31 11:59:59 as the default value in db instead of null?
----------------------------------------------------------------
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