Skip to content

Commit

Permalink
revert(functions): back out logging; it's super slow
Browse files Browse the repository at this point in the history
  • Loading branch information
jlucktay committed Feb 6, 2024
1 parent c206624 commit 86d57d2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 269 deletions.
1 change: 0 additions & 1 deletion functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
},
"main": "lib/src/index.js",
"dependencies": {
"@google-cloud/logging": "^11.0.0",
"firebase-admin": "^11.11.1",
"firebase-functions": "^4.6.0"
},
Expand Down
17 changes: 0 additions & 17 deletions functions/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { runWith } from "firebase-functions";
import { Logging } from "@google-cloud/logging";

// Start writing Firebase Functions
// https://firebase.google.com/docs/functions/typescript
Expand All @@ -8,16 +7,6 @@ const goVCSBase = "https://github.com/jlucktay";

export const goPackage = runWith({ memory: "128MB" }).https.onRequest(
(request, response) => {
const logging = new Logging();
const log = logging.log("goPackage");

const METADATA = {
resource: {
type: "cloud_function",
labels: { function_name: "goPackage" },
},
};

const firstSlash = request.path.substring(1).indexOf("/");
let basePackage = request.path;

Expand All @@ -36,9 +25,6 @@ export const goPackage = runWith({ memory: "128MB" }).https.onRequest(
const goImportMeta =
`<meta name="go-import" content="` + goImport.join(" ") + `">`;

const logGoImportMeta = { message: goImportMeta };
log.write(log.entry(METADATA, logGoImportMeta));

// https://github.com/golang/gddo/wiki/Source-Code-Links
// <meta name="go-source" content="prefix home directory file">
const goSource: string[] = [
Expand All @@ -51,9 +37,6 @@ export const goPackage = runWith({ memory: "128MB" }).https.onRequest(
const goSourceMeta =
`<meta name="go-source" content="` + goSource.join(" ") + `">`;

const logGoSourceMeta = { message: goSourceMeta };
log.write(log.entry(METADATA, logGoSourceMeta));

response.send(goImportMeta + "\n" + goSourceMeta + "\n");
},
);
Loading

0 comments on commit 86d57d2

Please sign in to comment.