@@ -3,6 +3,7 @@ import prisma from 'prisma/clientInstance'
33import { connectTransactionsListToPrices } from 'services/transactionService'
44import { Transaction } from '@prisma/client'
55import moment from 'moment'
6+ import { exit } from 'process'
67
78async function misconnectTxs ( txsIds : string [ ] ) : Promise < void > {
89 if ( process . env . ENVIRONMENT === 'production' ) {
@@ -11,6 +12,7 @@ async function misconnectTxs (txsIds: string[]): Promise<void> {
1112 if ( txsIds . length === 0 ) {
1213 return
1314 }
15+ console . log ( 'Misconnecting' , txsIds . length , 'for testing purposes' )
1416 for ( const txId of txsIds ) {
1517 const tx = await prisma . transaction . findUniqueOrThrow ( {
1618 where : {
@@ -31,6 +33,7 @@ async function misconnectTxs (txsIds: string[]): Promise<void> {
3133 }
3234 } )
3335 }
36+ console . log ( 'Finished misconnecting txs' )
3437}
3538
3639async function fixMisconnectedTxs ( ) : Promise < void > {
@@ -82,13 +85,15 @@ async function fixMisconnectedTxs (): Promise<void> {
8285 } )
8386 if ( txsToFix . length !== 0 ) {
8487 console . log ( `[${ viewedCount } /${ total } ] Fixing ${ txsToFix . length } txs...` )
88+ console . log ( 'Tx ids:\n' , txsToFix . map ( t => t . id ) . join ( '\n' ) )
8589 await connectTransactionsListToPrices ( txsToFix )
8690 console . log ( `[${ viewedCount } /${ total } ] Finished fixing ${ txsToFix . length } txs.` )
8791 }
8892 console . log ( `[${ viewedCount } /${ total } ]` )
8993 page ++
9094 }
9195 console . log ( 'FINISHED' )
96+ exit ( )
9297}
9398
9499async function run ( ) : Promise < void > {
0 commit comments