File tree 3 files changed +9
-6
lines changed
app-service/src/lib/scheduler
3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ services:
54
54
SYS_SERVER_SECRET_SALT : Rewrite_Your_Own_Secret_Salt_abcdefg1234567
55
55
SHARED_NETWORK : laf_shared_network
56
56
LOG_LEVEL : debug
57
- APP_SERVICE_IMAGE : lafyun/app-service:0.6.8
57
+ APP_SERVICE_IMAGE : lafyun/app-service:latest
58
58
ACCOUNT_DEFAULT_APP_QUOTA : 5
59
59
APP_SERVICE_DEPLOY_HOST : local-dev.host:8080 # `*.local-dev.host` always resolved to 127.0.0.1, used to local development
60
60
APP_SERVICE_DEPLOY_URL_SCHEMA : ' http'
Original file line number Diff line number Diff line change 1
1
/*
2
2
* @Author : Maslow<[email protected] >
3
3
* @Date : 2021-07-30 10:30:29
4
- * @LastEditTime : 2021-09-09 22:59:48
4
+ * @LastEditTime : 2021-11-05 14:46:49
5
5
* @Description :
6
6
*/
7
7
8
8
import { getFunctionById } from "../../api/function"
9
- import { addFunctionLog } from "../../api/function-log"
9
+ import { addFunctionLog , CloudFunctionLogStruct } from "../../api/function-log"
10
10
import { CloudFunction , TriggerScheduler } from "cloud-function-engine"
11
11
import { createLogger } from "../logger"
12
12
import assert = require( "assert" )
13
+ import { ObjectId } from "bson"
13
14
14
15
15
16
const logger = createLogger ( 'scheduler' )
@@ -41,7 +42,9 @@ export class FrameworkScheduler extends TriggerScheduler {
41
42
* @override
42
43
* @param data
43
44
*/
44
- async addFunctionLog ( data : any ) {
45
+ async addFunctionLog ( data : CloudFunctionLogStruct ) {
46
+ // func_id from TriggerScheduler is string type, convert it to ObjectId
47
+ data . func_id = new ObjectId ( data . func_id )
45
48
await addFunctionLog ( data )
46
49
}
47
50
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ export class TriggerScheduler {
87
87
* @returns
88
88
*/
89
89
protected async getFunctionById ( _func_id : string ) : Promise < CloudFunction > {
90
- throw new Error ( 'not implemented, you should drive TriggerScheduler class and override getFunctionById() method' )
90
+ throw new Error ( 'not implemented, you should derive TriggerScheduler class and override getFunctionById() method' )
91
91
}
92
92
93
93
/**
@@ -105,7 +105,7 @@ export class TriggerScheduler {
105
105
await this . addFunctionLog ( {
106
106
requestId : `trigger_${ trigger . id } ` ,
107
107
method : param . method ,
108
- func_id : func . id ,
108
+ func_id : func_id ,
109
109
func_name : func . name ,
110
110
logs : result . logs ,
111
111
time_usage : result . time_usage ,
You can’t perform that action at this time.
0 commit comments