Skip to content

Commit 308c4fa

Browse files
committed
fixup! Add 0xGasless plugin
1 parent fd39125 commit 308c4fa

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/partners/0xgasless.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export async function query0xGasless(
7373
let retry = 0
7474

7575
while (true) {
76+
let latestBlockIsoDate = latestIsoDate
7677
const startTimestamp = lastCheckedTimestamp
7778
const endTimestamp = lastCheckedTimestamp + QUERY_TIME_BLOCK_MS
7879

@@ -155,8 +156,8 @@ export async function query0xGasless(
155156
rawTx: trade
156157
}
157158
ssFormatTxs.push(ssTx)
158-
if (ssTx.isoDate > latestIsoDate) {
159-
latestIsoDate = ssTx.isoDate
159+
if (ssTx.isoDate > latestBlockIsoDate) {
160+
latestBlockIsoDate = ssTx.isoDate
160161
}
161162
}
162163

@@ -172,6 +173,7 @@ export async function query0xGasless(
172173
}
173174

174175
lastCheckedTimestamp = endTimestamp
176+
latestIsoDate = latestBlockIsoDate
175177
datelog(
176178
`0xGasless endDate:${new Date(
177179
lastCheckedTimestamp
@@ -189,8 +191,8 @@ export async function query0xGasless(
189191
datelog(`Snoozing ${60 * retry}s`)
190192
await snooze(60000 * retry)
191193
} else {
192-
// We can't safely save our progress since we go from newest to oldest.
193-
throw error
194+
// We can safely save our progress since we go from oldest to newest.
195+
break
194196
}
195197
}
196198

src/partners/paybis.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ export async function queryPaybis(
175175

176176
while (true) {
177177
const endTime = startTime + QUERY_TIME_BLOCK_MS
178+
let latestBlockIsoDate = latestIsoDate
178179

179180
try {
180181
let cursor: string | undefined
@@ -239,8 +240,8 @@ export async function queryPaybis(
239240
rawTx
240241
}
241242
ssFormatTxs.push(ssTx)
242-
if (ssTx.isoDate > latestIsoDate) {
243-
latestIsoDate = ssTx.isoDate
243+
if (ssTx.isoDate > latestBlockIsoDate) {
244+
latestBlockIsoDate = ssTx.isoDate
244245
}
245246
}
246247
if (cursor == null) {
@@ -252,6 +253,7 @@ export async function queryPaybis(
252253

253254
const endDate = new Date(endTime)
254255
startTime = endTime
256+
latestIsoDate = latestBlockIsoDate
255257
datelog(
256258
`Paybis endDate:${endDate.toISOString()} latestIsoDate:${latestIsoDate}`
257259
)

0 commit comments

Comments
 (0)