File tree 1 file changed +3
-14
lines changed
cli/serverless/nodejs/templates
1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change 6
6
_writeSFNHeader,
7
7
_FunctionCall,
8
8
_createConnection,
9
- withTimeout,
10
9
} from '@yomo/sfn'
11
10
import { description, tag, handler } from '{{ .FileName }}'
12
11
@@ -16,8 +15,6 @@ const SFN_FILE_PATH = '{{ .FilePath }}'
16
15
const SOCK_PATH = join(WORK_DIR, 'sfn.sock');
17
16
const REDUCE_TAG = 0xe001;
18
17
19
- const TIMEOUT_DURATION = 1000 * 60
20
-
21
18
function run() {
22
19
if (
23
20
!description ||
@@ -37,20 +34,12 @@ function run() {
37
34
_writeSFNHeader(conn, header)
38
35
},
39
36
onData: async (buf: Buffer) => {
40
- const { tag, data } = _readSFNData(buf)
37
+ const { data } = _readSFNData(buf)
41
38
const fc = new _FunctionCall(data)
42
39
const args = fc.readLLMArguments()
43
- let result: any
40
+ let result: unknown
44
41
if (typeof handler === 'function') {
45
- try {
46
- result = await withTimeout(handler(args), TIMEOUT_DURATION)
47
- } catch (error) {
48
- if (error instanceof Error && error.message === 'timeout') {
49
- fc.writeLLMResult('timeout in this function calling, you should ignore this.')
50
- _writeSFNData(conn, REDUCE_TAG, JSON.stringify(fc.data))
51
- }
52
- return
53
- }
42
+ result = await handler(args)
54
43
}
55
44
if (!result) return
56
45
fc.writeLLMResult(JSON.stringify(result))
You can’t perform that action at this time.
0 commit comments