コード例 #1
0
        void AddToBatch(long accountId)
        {
            for (var i = 0; i < _batches.Count; i++)
            {
                var batch = _batches[i];
                if (batch.Contains(accountId))
                {
                    return;
                }
            }

            for (var i = 0; i < _batches.Count; i++)
            {
                var batch = _batches[i];
                if (batch.AddSubscription(accountId))
                {
                    return;
                }
            }

            var newBatch = new SubsriptionBatch(_batches.Count);

            newBatch.AddSubscription(accountId);
            _batches.Add(newBatch);
        }
コード例 #2
0
        internal bool ProcessLastTransactionInfo(SubsriptionBatch batch, LastTransactionCountInfoBatch batchInfo)
        {
            var subs = new List <SubscriptionInfo>();

            batch.UpdateLastChecked();

            for (var j = 0; j < batchInfo.Count; j++)
            {
                (var found, var accountId, var info) = batchInfo.GetInfo(j);
                if (found && info != null)
                {
                    UpdateCurrentTransactionInfo(accountId, info, subs);
                }
            }

            if (subs.Count > 0)
            {
                SortSubscriptions(subs);

                return(true);
            }

            return(false);
        }