Beispiel #1
0
        // Must be ok to call multiple times!
        public async Task Discard()
        {
            if (TransactionState == TransactionState.Committed)
            {
                return;
            }

            if (TransactionState != TransactionState.Aborted)
            {
                TransactionState = TransactionState.Aborted;

                if (!HasMutated)
                {
                    return;
                }

                Context.Aborted = true;

                try {
                    await Client.Discard(Context);
                } catch (RpcException) {
                    // Eat it ... nothing else to do? Dgraph will clean up eventually?
                }
            }
        }