Ejemplo n.º 1
0
        private void PerformStatsGc()
        {
            logger.Info(() => $"Performing Stats GC");

            cf.Run(con =>
            {
                var cutOff = DateTime.UtcNow.AddMonths(-3);

                var rowCount = statsRepo.DeletePoolStatsBefore(con, cutOff);
                if (rowCount > 0)
                {
                    logger.Info(() => $"Deleted {rowCount} old poolstats records");
                }

                rowCount = statsRepo.DeleteMinerStatsBefore(con, cutOff);
                if (rowCount > 0)
                {
                    logger.Info(() => $"Deleted {rowCount} old minerstats records");
                }
            });

            logger.Info(() => $"Stats GC complete");
        }