Skip to content

Conversation

@flytutu-susu
Copy link

@flytutu-susu flytutu-susu commented Sep 28, 2024

Description (what this PR does / why we need it):

image
此为对空[]byte进行json.Unmarshal时的错误。

触发Write时,可能导致读取的内容为空
image

通过添加延时一毫秒去抖,能每次都读取到文件内容
image
2024/09/29 10:27:42 event: WRITE 2024/09/29 10:27:42 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:42 event: WRITE 2024/09/29 10:27:42 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:42 event: WRITE 2024/09/29 10:27:42 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:42 event: WRITE 2024/09/29 10:27:42 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:42 event: WRITE 2024/09/29 10:27:42 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:42 event: WRITE 2024/09/29 10:27:42 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:43 event: WRITE 2024/09/29 10:27:43 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:43 event: WRITE 2024/09/29 10:27:43 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:43 event: WRITE 2024/09/29 10:27:43 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:43 event: WRITE 2024/09/29 10:27:43 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:43 event: WRITE 2024/09/29 10:27:43 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:43 event: WRITE 2024/09/29 10:27:43 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:43 event: WRITE 2024/09/29 10:27:43 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:43 event: WRITE 2024/09/29 10:27:43 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:43 event: WRITE 2024/09/29 10:27:43 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:44 event: WRITE 2024/09/29 10:27:44 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:44 event: WRITE 2024/09/29 10:27:44 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:44 event: WRITE 2024/09/29 10:27:44 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:44 event: WRITE 2024/09/29 10:27:44 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:44 event: WRITE 2024/09/29 10:27:44 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:44 event: WRITE 2024/09/29 10:27:44 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:45 event: WRITE 2024/09/29 10:27:45 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:45 event: WRITE 2024/09/29 10:27:45 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:45 event: WRITE 2024/09/29 10:27:45 modified file: tmp/a.txt [49 50 51] 2024/09/29 10:27:45 event: WRITE 2024/09/29 10:27:45 modified file: tmp/a.txt [49 50 51]
每次触发事件均能读取成功

Which issue(s) this PR fixes (resolves / be part of):

Other special notes for the reviewers:

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Sep 28, 2024
shenqidebaozi
shenqidebaozi previously approved these changes Mar 21, 2025
@dosubot dosubot bot added the LGTM label Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LGTM size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants