mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-27 13:34:15 -07:00
Disallow floating promises. (#14605)
This commit is contained in:
committed by
GitHub
parent
3cf44acc08
commit
025e450ac2
@@ -284,6 +284,7 @@ export class ClearcutLogger {
|
||||
event: LogEvent,
|
||||
): Promise<void> {
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
this.config?.getExperimentsAsync().then((experiments) => {
|
||||
if (experiments) {
|
||||
const exp_id_data: EventValue[] = [
|
||||
@@ -557,6 +558,7 @@ export class ClearcutLogger {
|
||||
this.sessionData = data;
|
||||
|
||||
// Flush after experiments finish loading from CCPA server
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
this.enqueueLogEventAfterExperimentsLoadAsync(
|
||||
this.createLogEvent(EventNames.START_SESSION, data),
|
||||
).then(() => {
|
||||
@@ -900,6 +902,7 @@ export class ClearcutLogger {
|
||||
];
|
||||
|
||||
// Flush after experiments finish loading from CCPA server
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
this.enqueueLogEventAfterExperimentsLoadAsync(
|
||||
this.createLogEvent(EventNames.START_SESSION, data),
|
||||
).then(() => {
|
||||
|
||||
@@ -96,6 +96,7 @@ export class GcpLogExporter implements LogRecordExporter {
|
||||
.finally(() => {
|
||||
const index = this.pendingWrites.indexOf(writePromise);
|
||||
if (index > -1) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
this.pendingWrites.splice(index, 1);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -94,6 +94,7 @@ export function isTelemetrySdkInitialized(): boolean {
|
||||
|
||||
export function bufferTelemetryEvent(fn: () => void | Promise<void>): void {
|
||||
if (telemetryInitialized) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
fn();
|
||||
} else {
|
||||
telemetryBuffer.push(fn);
|
||||
@@ -303,9 +304,11 @@ export async function initializeTelemetry(
|
||||
// and won't wait for the async shutdownTelemetry() to complete.
|
||||
// Instead, telemetry shutdown is handled in runExitCleanup() in cleanup.ts
|
||||
process.on('SIGTERM', () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
shutdownTelemetry(config);
|
||||
});
|
||||
process.on('SIGINT', () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
shutdownTelemetry(config);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user