Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit ada7125

Browse files
author
Scott Bommarito
authored
Hotfix: stats total download counts overflow
1 parent dde504d commit ada7125

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/Stats.CreateAzureCdnWarehouseReports/GalleryTotalsReport.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public async Task Run()
4646
using (var connection = await StatisticsDatabase.ConnectTo())
4747
using (var transaction = connection.BeginTransaction(IsolationLevel.Snapshot))
4848
{
49-
totalsData.Downloads = (await connection.ExecuteScalarWithRetryAsync<int>(
49+
totalsData.Downloads = (await connection.ExecuteScalarWithRetryAsync<long>(
5050
WarehouseStoredProcedureName, commandType: CommandType.StoredProcedure, transaction: transaction));
5151
}
5252
Trace.TraceInformation("Total downloads: {0}", totalsData.Downloads);

src/Stats.Warehouse/Programmability/Stored Procedures/dbo.SelectTotalDownloadCounts.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ BEGIN
44
SET NOCOUNT ON;
55

66
-- select total # of downloads + correction for packages that can not be mapped
7-
SELECT SUM(ISNULL(F.[DownloadCount], 0)) - 21000000 AS [Downloads]
7+
SELECT SUM(CAST(ISNULL(F.[DownloadCount], 0) AS BIGINT)) - 21000000 AS [Downloads]
88
FROM [dbo].[Fact_Download] (NOLOCK) AS F
99
END

0 commit comments

Comments
 (0)