fix(os/gcfg): ignore fsnotify event error to avoid package gcfg totally failing#4400
Merged
hailaz merged 5 commits intogogf:masterfrom Nov 21, 2025
Merged
fix(os/gcfg): ignore fsnotify event error to avoid package gcfg totally failing#4400hailaz merged 5 commits intogogf:masterfrom
hailaz merged 5 commits intogogf:masterfrom
Conversation
Contributor
Author
|
Fixes #4400 |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a file event monitoring error that prevents Go projects from starting when located on network-mapped drives in Windows 11. The fix converts the error from a fatal failure to a warning message, allowing the application to continue running without file monitoring.
- Wraps file event monitoring in a defer function to handle errors gracefully
- Changes error handling from returning nil to printing a warning message
- Adds fmt import for warning output
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
gqcn
previously requested changes
Oct 22, 2025
Contributor
|
@aitimate |
- 立即调用 gfsnotify.Add 注册文件监控(移除原来的 defer 包装),确保监控及时生效 - 回调中移除 json 缓存并调用 event.Watcher.Remove(filePath) 以取消对已变更文件的监控 - 使用 intlog.Errorf 记录错误并移除未使用的 fmt 导入 style(gfsnotify): 统一方法签名格式化 - 将 Add / AddOnce / addWithCallbackFunc 的参数签名合并为单行,统一代码风格
hailaz
approved these changes
Nov 21, 2025
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.
问题描述: Windows 11 文件夹映射的网络驱动器里面的go项目在启动的时候会因为系统没有映射磁盘的文件事件监听而报错,从而导致整个项目启动失败,目前我临时的修复是将该错误改为警告进行打印