File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
libs/services/src/AffiliateProgramExportService Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ function getAffiliateStatsCacheTtlMs(): number {
8383 }
8484
8585 const parsed = Number ( rawValue ) ;
86- if ( ! Number . isFinite ( parsed ) || parsed <= 0 ) {
86+ if ( ! Number . isFinite ( parsed ) || parsed < 0 ) {
8787 logger . warn (
8888 `Invalid DUNE_AFFILIATE_STATS_CACHE_TTL_MS value: ${ rawValue } . Using default ${ DEFAULT_AFFILIATE_STATS_CACHE_TTL_MS } ms.`
8989 ) ;
Original file line number Diff line number Diff line change @@ -89,11 +89,17 @@ export class AffiliateProgramExportServiceImpl
8989
9090 private async upload ( rows : AffiliateProgramRow [ ] ) : Promise < void > {
9191 const csv = buildCsv ( rows ) ;
92- await this . duneRepository . uploadCsv ( {
92+ const response = await this . duneRepository . uploadCsv ( {
9393 tableName : AFFILIATE_PROGRAM_TABLE_NAME ,
9494 data : csv ,
9595 isPrivate : true ,
9696 } ) ;
97+ if ( ! response . success ) {
98+ const message = response . message ? `: ${ response . message } ` : '' ;
99+ throw new Error (
100+ `Dune CSV upload failed for ${ AFFILIATE_PROGRAM_TABLE_NAME } ${ message } `
101+ ) ;
102+ }
97103 }
98104}
99105
You can’t perform that action at this time.
0 commit comments