FinnTew commented on code in PR #777:
URL: 
https://github.com/apache/incubator-seata-go/pull/777#discussion_r1959333860


##########
pkg/tm/global_transaction.go:
##########
@@ -151,3 +159,17 @@ func (g *GlobalTransactionManager) Rollback(ctx 
context.Context, gtr *GlobalTran
 
        return nil
 }
+
+func isTimeout(ctx context.Context) bool {

Review Comment:
   Is it better to sort out the false conditions in the `isTimeout` method? For 
example, as follows:
   
   ```go
   func isTimeout(ctx context.Context) bool {
        ti := GetTimeInfo(ctx)
        if ti == nil || ti.createTime == 0 || ti.timeout == 0 {
                return false
        }
   
        return time.Since(time.Unix(int64(ti.createTime), 0)) > ti.timeout
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org
For additional commands, e-mail: notifications-h...@seata.apache.org

Reply via email to