Dev/kirisamejin/support file list and get - #32
Conversation
|
应该还得在agent和agentcentral加上test |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #32 +/- ##
==========================================
- Coverage 41.96% 37.55% -4.41%
==========================================
Files 88 89 +1
Lines 2414 2809 +395
==========================================
+ Hits 1013 1055 +42
- Misses 1339 1684 +345
- Partials 62 70 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| --fileservicefe, --no-fileservicefe | ||
| build fileservicefe (default: False) | ||
|
|
||
| ./tools/testscripts/devstart.sh |
There was a problem hiding this comment.
这个最好新开一个section,然后写个什么 dev env 启动之类的title
|
|
||
| type FileListRequest struct { | ||
| OperationId string | ||
| Node string `json:"nodes"` |
| ah.responsesMutex.Lock() | ||
| delete(ah.pendingFileGetOps, operationId) | ||
| ah.responsesMutex.Unlock() | ||
| return nil, fmt.Errorf("timeout waiting for response") |
|
|
||
| func (ah *agentHolder) AddFileListRequest(operationId, path string) error { | ||
| ah.fileRequestsMutex.Lock() | ||
| defer ah.fileRequestsMutex.Unlock() |
There was a problem hiding this comment.
这里是不是可以不用defer, append成功就可以unlock了
There was a problem hiding this comment.
我想了一下(虽然这个代码也是AI写的),如果append之后unlock,这个时候pendingFileListOps还没加上,就可以addRequestToHB,然后再下一次HB返回的时候如果还没加上,就会找不到对应的pendingFileListOps。但应该不会出现这种情况。
| // Add file operation request queues | ||
| fileListRequests []models.FileListRequest | ||
| fileGetRequests []models.FileGetRequest | ||
| fileRequestsMutex sync.Mutex |
There was a problem hiding this comment.
fileListRequests和fileGetRequests为啥共用同一个锁
确实得加,不加coverage太低了 |
| s.fakeFileServer.AddFileContent(path.Join("TestPublicFileDownload", "a.txt"), content) | ||
| url := fakefileserver.BuildDownloadURL(s.fakeFileServer, path.Join("TestPublicFileDownload", "a.txt")) | ||
| // Use forward slashes for URL paths, not path.Join which uses OS-specific separators | ||
| serverPath := "TestPublicFileDownload/a.txt" |
|
其他都OK,就加点test就行 |
…ithub.com/lukaproject/Linda into dev/kirisamejin/support-file-list-and-get
Closes #22