-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update non-major-dev-dependencies #367
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,7 +183,7 @@ export const runUpdateFeeds = async (providerName: string, chain: Chain, chainId | |
provider, | ||
chainId, | ||
firstBatchBlockNumber | ||
).catch((error) => error); | ||
).catch((error: any) => error); | ||
|
||
// Calculate the stagger time. | ||
const batchesCount = Math.ceil(activeDataFeedCount! / dataFeedBatchSize); | ||
|
@@ -226,13 +226,11 @@ export const runUpdateFeeds = async (providerName: string, chain: Chain, chainId | |
|
||
// Wait for all the batches to be processed and print stats from this run. | ||
const processedBatches = await Promise.all([ | ||
new Promise<Awaited<ReturnType<typeof processBatch>>>((resolve, reject) => { | ||
return processFirstBatchPromise.then((result) => { | ||
// eslint-disable-next-line promise/always-return | ||
if (isError(result)) reject(result); | ||
else resolve(result); | ||
}); | ||
}), | ||
(async (): Promise<Awaited<ReturnType<typeof processBatch>>> => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made these changes in response to an issue caused by upgrading @total-typescript/ts-reset from version 0.5.1 to 0.6.1, which resulted in TypeScript compilation errors. The update introduced stricter type-checking that required a more explicit approach to handling types and promises. This immediately invoked function approach also improves code readability. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TBH: I'm not a huge fan of IIFE in regards to readability. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. So, would you prefer to use previous approach or do you have better suggestion on this? I can change this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nah, I think it's not worth to change this. I think I'd prefer the previous approach (but not sure what was the TS issue there). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mostly wanted express my opinion on that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The error was for this part:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mhh, strange. Just from the looks of it I don't know what is wrong. But I think you're solution is good OK, so wouldn't bother investigating further. |
||
const batchOrError = await processFirstBatchPromise; | ||
if (isError(batchOrError)) throw batchOrError; | ||
return batchOrError; | ||
})(), | ||
...processOtherBatchesPromises, | ||
]); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In new version 0.6.1 of
@total-typescript/ts-reset
, catch resolves output as unknown rather than any.