Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
chore: Clean up dead code and linter errors (#1166)
Browse files Browse the repository at this point in the history
  • Loading branch information
mctavish authored Sep 7, 2023
1 parent 4c1e453 commit 65ba82f
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 2,772 deletions.
9 changes: 7 additions & 2 deletions src/agent/firebase-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import * as crypto from 'crypto';

import * as firebase from 'firebase-admin';
import * as gcpMetadata from 'gcp-metadata';
import {DataSnapshot} from 'firebase-admin/database';

import * as util from 'util';
const debuglog = util.debuglog('cdbg.firebase');
Expand All @@ -37,7 +38,11 @@ const FIREBASE_APP_NAME = 'cdbg';
* @param promise
* @returns Promise wrapped in a timeout.
*/
const withTimeout = (ms: number, promise: Promise<any>) => {
const withTimeout = (
ms: number,
promise: Promise<DataSnapshot>
): Promise<unknown> => {
// Note that the type above is constrained to make the linter happy.
const timeout = new Promise((_, reject) =>
setTimeout(() => reject(`Timed out after ${ms} ms.`), ms)
);
Expand Down Expand Up @@ -126,7 +131,7 @@ export class FirebaseController implements Controller {
db.ref('cdbg/schema_version').get()
);
if (version_snapshot) {
const version = version_snapshot.val();
const version = (version_snapshot as DataSnapshot).val();
debuglog(
`Firebase app initialized. Connected to ${databaseUrl}` +
` with schema version ${version}`
Expand Down
Loading

0 comments on commit 65ba82f

Please sign in to comment.