Conversation
abbd147 to
b4c3f0d
Compare
rsonghuster
reviewed
Jan 19, 2026
| enableInstanceMetrics: true | ||
| enableRequestMetrics: true | ||
| logBeginRule: DefaultRegex | ||
| enableInstanceMetrics: ${customFields.enableInstanceMetrics} |
Contributor
There was a problem hiding this comment.
这个感觉有点问题啊,不应该是跟 376-380 行一样的逻辑吗
rsonghuster
reviewed
Jan 19, 2026
| const { project, logstore } = await sls.deploy(); | ||
| const logAutoConfig = parseAutoConfig(this.local.logConfig as string); | ||
| const logParams = logAutoConfig?.params || {}; | ||
| const existingLogConfig = |
Contributor
There was a problem hiding this comment.
这里已经是 sls Auto 的逻辑了, 为什么还有 existingLogConfig?
rsonghuster
reviewed
Jan 19, 2026
| handler: index.handler | ||
| memorySize: 128 | ||
| timeout: 60 | ||
| nasConfig: auto|mountDir=/custom/nas/mount/path|serverAddr=/custom/nas/mount/path |
Contributor
rsonghuster
reviewed
Jan 19, 2026
src/subCommands/model/index.ts
Outdated
| const customMountDir = params.mountDir | ||
| ? validateAndNormalizePath(params.mountDir, 'mountDir') | ||
| : `/mnt/${functionName}`; | ||
| const customServerAddr = params.serverAddr ? params.serverAddr : `${functionName}`; |
Contributor
There was a problem hiding this comment.
这个 params.serverAddr 名字叫 params.nasDir 更容易理解点, 而且和 fc 的 serverAddr 没有冲突
rsonghuster
reviewed
Jan 19, 2026
src/subCommands/model/index.ts
Outdated
| let serverAddr = `${mountTargetDomain}:/${functionName}`; | ||
| const nasAutoConfig = parseAutoConfig(this.local.nasConfig as string); | ||
| const params = nasAutoConfig?.params || {}; | ||
| const customMountDir = params.mountDir |
Contributor
There was a problem hiding this comment.
customMountDir 改成 fcDir 吧,更容易理解点
rsonghuster
reviewed
Jan 19, 2026
src/subCommands/model/index.ts
Outdated
| const nasAutoConfig = parseAutoConfig(this.local.nasConfig as string); | ||
| const params = nasAutoConfig?.params || {}; | ||
| const customMountDir = params.mountDir | ||
| ? validateAndNormalizePath(params.mountDir, 'mountDir') |
Contributor
rsonghuster
reviewed
Jan 20, 2026
src/utils/index.ts
Outdated
| * 验证并规范化路径 | ||
| */ | ||
| export function validateAndNormalizePath(path: string, paramName = 'path'): string { | ||
| if (typeof path !== 'string') { |
Contributor
There was a problem hiding this comment.
265-286 行没有任何意思, 不满足直接报错就好了
rsonghuster
reviewed
Jan 20, 2026
src/utils/index.ts
Outdated
| if (normalizedPath === prefix || normalizedPath.startsWith(`${prefix}/`)) { | ||
| const message = `Invalid ${paramName}, ${prefix} and its subdirectories are not allowed`; | ||
| if (logger) logger.warn(message); | ||
| return '/'; |
rsonghuster
reviewed
Jan 20, 2026
src/utils/index.ts
Outdated
| if (normalizedPath === '/mnt' || normalizedPath === '/mnt/') { | ||
| const message = `Invalid ${paramName}, /mnt without subdirectory is not allowed`; | ||
| if (logger) logger.warn(message); | ||
| return '/'; |
Contributor
There was a problem hiding this comment.
直接报错, 你传给 fc, fc 那边还是会报错, 还不如直接拦了
rsonghuster
reviewed
Jan 20, 2026
src/utils/index.ts
Outdated
| /** | ||
| * 验证并规范化路径 | ||
| */ | ||
| export function validateAndNormalizePath(path: string, paramName = 'path'): string { |
Contributor
There was a problem hiding this comment.
函数validateAndNormalizePath名字就叫 checkFcDir , 语义明确点
aba2c4b to
d91d422
Compare
rsonghuster
reviewed
Jan 20, 2026
src/utils/index.ts
Outdated
| } | ||
|
|
||
| // 检查 /mnt 是否为顶级目录且没有子目录 | ||
| if (normalizedPath === '/mnt' || normalizedPath === '/mnt/') { |
Contributor
There was a problem hiding this comment.
我只是举个例子啊! 不是固定的 /mnt 。。。。。
ad984e2 to
8c3890c
Compare
8c3890c to
35e097b
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


No description provided.