-
-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(app-service): clean unused codes; remove cloud.storage() #21
- Loading branch information
Showing
32 changed files
with
153 additions
and
1,362 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
const { createCloudFunctionDeclarationPackage } = require("../dist/lib/utils/init"); | ||
const { createCloudFunctionDeclarationPackage } = require("../dist/api/init"); | ||
|
||
createCloudFunctionDeclarationPackage() | ||
createCloudFunctionDeclarationPackage() | ||
|
||
process.exit(0) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* @Author: Maslow<[email protected]> | ||
* @Date: 2021-07-30 10:30:29 | ||
* @LastEditTime: 2021-11-05 13:38:09 | ||
* @LastEditTime: 2022-02-03 00:58:33 | ||
* @Description: | ||
*/ | ||
|
||
|
@@ -37,4 +37,41 @@ export async function getFunctionById(func_id: string) { | |
}) | ||
|
||
return doc as any | ||
} | ||
|
||
|
||
export interface CloudFunctionLogStruct { | ||
requestId: string | ||
method: string | ||
func_id: ObjectId | ||
func_name: string | ||
logs: string[] | ||
time_usage: number | ||
data: any | ||
error: Error | ||
debug?: boolean | ||
created_at?: Date | ||
created_by?: any | ||
} | ||
|
||
/** | ||
* Add function execution log | ||
* @param data | ||
* @returns | ||
*/ | ||
export async function addFunctionLog(data: CloudFunctionLogStruct): Promise<any> { | ||
const db = DatabaseAgent.db | ||
|
||
if (!data) return null | ||
if (typeof data.error === 'object') { | ||
data.error = data.error.toString() as any | ||
} | ||
|
||
const r = await db.collection(Constants.function_log_collection) | ||
.insertOne({ | ||
...data, | ||
created_at: new Date() | ||
}) | ||
|
||
return r.insertedId | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* @Author: Maslow<[email protected]> | ||
* @Date: 2021-08-16 15:29:15 | ||
* @LastEditTime: 2021-11-03 17:10:04 | ||
* @LastEditTime: 2022-02-03 00:42:33 | ||
* @Description: | ||
*/ | ||
|
||
|
@@ -10,7 +10,6 @@ import { MongoAccessor } from 'database-proxy' | |
import Config from '../../config' | ||
import { createLogger, logger } from '../logger' | ||
import * as mongodb_uri from 'mongodb-uri' | ||
import { ensureCollectionIndexes } from '../../api/indexes' | ||
|
||
|
||
/** | ||
|
@@ -45,7 +44,6 @@ export class DatabaseAgent { | |
accessor.init() | ||
.then(async () => { | ||
logger.info('db connected') | ||
await ensureCollectionIndexes() | ||
}) | ||
.catch(error => { | ||
logger.error(error) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
/* | ||
* @Author: Maslow<[email protected]> | ||
* @Date: 2021-07-30 10:30:29 | ||
* @LastEditTime: 2021-11-09 20:02:51 | ||
* @LastEditTime: 2022-02-03 00:58:59 | ||
* @Description: | ||
*/ | ||
|
||
import { getFunctionById } from "../../api/function" | ||
import { addFunctionLog, CloudFunctionLogStruct } from "../../api/function-log" | ||
import { addFunctionLog, CloudFunctionLogStruct } from "../../api/function" | ||
import { TriggerScheduler } from "cloud-function-engine" | ||
import { createLogger } from "../logger" | ||
import assert = require("assert") | ||
|
Oops, something went wrong.