Apply suggestions from code review
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
This commit is contained in:
@@ -13,7 +13,7 @@ const doubleLineBreakRegexp = /\n\r?\n/;
|
|||||||
export async function readJsonlFile<T>(
|
export async function readJsonlFile<T>(
|
||||||
path: string,
|
path: string,
|
||||||
handler: (value: T) => Promise<void>,
|
handler: (value: T) => Promise<void>,
|
||||||
logger?: { log: (message: string) => void },
|
logger?: BaseLogger,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
// Stream the data as large evaluator logs won't fit in memory.
|
// Stream the data as large evaluator logs won't fit in memory.
|
||||||
// Also avoid using 'readline' as it is slower than our manual line splitting.
|
// Also avoid using 'readline' as it is slower than our manual line splitting.
|
||||||
@@ -48,7 +48,7 @@ export async function readJsonlFile<T>(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void logger?.log(`Finishing parsing ${path}`);
|
void logger?.log(`Finished parsing ${path}`);
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
stream.on("error", reject);
|
stream.on("error", reject);
|
||||||
|
|||||||
Reference in New Issue
Block a user