Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bcs-bscp): feedserver support sync download file api #3122

Merged
merged 6 commits into from
Apr 24, 2024

Conversation

AlkaidChan
Copy link
Collaborator

@AlkaidChan AlkaidChan commented Apr 15, 2024

No description provided.

@AlkaidChan AlkaidChan added the bcs-bscp feature or bugfix for bscp label Apr 15, 2024
@AlkaidChan AlkaidChan changed the title feat(bcs-bscp): feedserver support sync download file api [WIP] feat(bcs-bscp): feedserver support sync download file api Apr 15, 2024
@AlkaidChan AlkaidChan changed the title [WIP] feat(bcs-bscp): feedserver support sync download file api feat(bcs-bscp): feedserver support sync download file api Apr 17, 2024
@AlkaidChan AlkaidChan requested a review from ifooth April 17, 2024 08:58
@@ -130,3 +133,20 @@ func (c *client) BatchUpsertClientMetrics(kt *kit.Kit, clientData []*pbclient.Cl
}
return nil
}

func (c *client) GetAsyncDownloadTask(kt *kit.Kit, bizID uint32, taskID string) (string, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里怎么没有lint错误

@@ -202,6 +208,8 @@ func (fs *feedServer) finalizer() {
return
}

fs.cleaner.Stop()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不需要defer stop么? 看上面已经return了

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我把这个移到上面就行了

return r, nil
}

func (s *Service) getAsyncDownloadClientInfo(ctx context.Context, req *pbfs.AsyncDownloadReq) (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Id / ID 不好混用,看看以前是用那个,保持统一下, BKAgentId

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里应该是没有混用,所有我们自己定义的都是 XxxID,XxxId 这种是 proto 生成的

k8s.io/klog/v2 v2.110.1
)

require (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indirect 合并下

"download_speed": 0,
"tasks": []map[string]interface{}{
{
"source": map[string]interface{}{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉这里可以用struct封装下, source, target是一个, agent是一个


func (s *Service) checkAndDownloadFile(kit *kit.Kit, filePath, signature string) error {
// block until file download
s.fileLock.Lock(filePath)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只对文件路径加锁,不同业务,app文件路径一样,内容不一样,加锁是不是不符合预期?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的文件路径是这样的:
/data/gse/source/files/{bizID}/{sha256}

@ifooth ifooth merged commit 2b89966 into TencentBlueKing:master Apr 24, 2024
9 of 11 checks passed
wenxinlee2015 added a commit that referenced this pull request Apr 24, 2024
* github-bk-bcs/master:
  feat: 拉取趋势返回默认值、新增统计次类原因 (#3147)
  feat(bcs-bscp): feedserver support sync download file api (#3122)
  feat: 客户端没有服务添加空状态 (#3146)
  feat: 脚本标签支持配置多个;脚本描述支持展示和编辑 (#3145)
  refactor: 格式问题调整 (#3143)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bcs-bscp feature or bugfix for bscp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants