Пример #1
0
        public async ValueTask <OperationResult> CleanAndKeepLastRecordsAsync(DbTable table, string partitionKey, int amount,
                                                                              DataSynchronizationPeriod synchronizationPeriod)
        {
            var(dbPartition, dbRows) = table.CleanAndKeepLastRecords(partitionKey, amount);

            if (dbPartition != null)
            {
                _dataSynchronizer.SynchronizeDelete(table, dbRows);

                await _persistenceHandler.SynchronizePartitionAsync(table, dbPartition.PartitionKey, synchronizationPeriod);
            }

            return(OperationResult.Ok);
        }