Exemplo n.º 1
0
        public void IncrementUrlTableLength()
        {
            TotalEntity temp = (TotalEntity)statsTable.Execute(TableOperation
                                                               .Retrieve <TotalEntity>(urlTotalCount.PartitionKey, urlTotalCount.RowKey)).Result;

            if (Math.Abs(temp.ItemCount - urlTotalCount.ItemCount) > 10)
            {
                // de-sync noticed, update our local to the remote
                urlTotalCount = temp;
            }
            urlTotalCount.IncrementCount();
            statsTable.Execute(TableOperation.InsertOrReplace(urlTotalCount));
        }
Exemplo n.º 2
0
        public void IncrementTotalUrlsCrawled()
        {
            TotalEntity temp = (TotalEntity)statsTable.Execute(TableOperation
                                                               .Retrieve <TotalEntity>(allUrlsCrawled.PartitionKey, allUrlsCrawled.RowKey)).Result;

            // allow for some wiggle room, in case the request takes a while
            if (Math.Abs(temp.ItemCount - allUrlsCrawled.ItemCount) > 10)
            {
                // de-sync noticed, update our local to the remote
                allUrlsCrawled = temp;
            }
            allUrlsCrawled.IncrementCount();
            statsTable.Execute(TableOperation.InsertOrReplace(allUrlsCrawled));
        }