File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,14 @@ await evaluate({
99
99
fetchRoundDetails,
100
100
ieContractWithSigner,
101
101
logger : console ,
102
- recordTelemetry
102
+ recordTelemetry,
103
+
104
+ // We don't want dry runs to update data in `sparks_stats`, therefore we are passing a stub
105
+ // connection factory that creates no-op clients. This also keeps the setup simpler. The person
106
+ // executing a dry run does not need access to any Postgres instance.
107
+ // Evaluate uses the PG client only for updating the statistics, it's not reading any data.
108
+ // Thus it's safe to inject a no-op client.
109
+ createPgClient : createNoopPgClient
103
110
} )
104
111
105
112
console . log ( process . memoryUsage ( ) )
@@ -209,3 +216,14 @@ async function fetchMeasurementsAddedFromChain (roundIndex) {
209
216
210
217
return events . filter ( e => e . roundIndex . eq ( roundIndex ) ) . map ( e => e . cid )
211
218
}
219
+
220
+ function createNoopPgClient ( ) {
221
+ return {
222
+ async query ( ) {
223
+ return { rows : [ ] }
224
+ } ,
225
+ async end ( ) {
226
+ // no-op
227
+ }
228
+ }
229
+ }
You can’t perform that action at this time.
0 commit comments