Giter Site home page Giter Site logo

Comments (8)

dosubot avatar dosubot commented on May 24, 2024 2

Hi, @banfg56,

I'm helping the Kratos team manage their backlog and am marking this issue as stale. From what I understand, you opened this issue to address inconsistencies in the rules for loading configuration files before and after the initial load, particularly when using fsnotify to monitor directory changes. There have been discussions and potential solutions offered by various contributors, but the issue remains unresolved.

Could you please confirm if this issue is still relevant to the latest version of the Kratos repository? If it is, please let the Kratos team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.

Thank you for your understanding and contributions to Kratos!

from kratos.

kratos-ci-bot avatar kratos-ci-bot commented on May 24, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The first loading of the file is inconsistent with the loading rules during monitoring

1. Rules for loading configuration items for the first time

Line 51 in config/file/file.go will determine that the currently loaded configuration configuration is a directory and a special file starting with ".". ignore if yes

2. Use fsnotify to monitor directory changes and load rules after

In config/file/watcher.go line 55, load all files directly

Impact and improvements

For deployment on Linux, it is very unfriendly to use vim to view the configuration file online. .swp file reports an error and the entire content is printed. Can the following improvements be made:
[ ] Allows you to specify the configuration file format when loading the configuration, such as: json, ini, etc.
[ ] .swp type file recording rules remain consistent

Attached is the scene of vi opening files in the fsnotify monitoring directory

Uploading image.png…

from kratos.

kratos-ci-bot avatar kratos-ci-bot commented on May 24, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Attached is the scene of vi opening a file in the fsnotify monitoring directory
Uploading WechatIMG919.jpg…

from kratos.

kratos-ci-bot avatar kratos-ci-bot commented on May 24, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


![Uploading WechatIMG919.jpg…] (Attached is the scene of vi opening the file in the fsnotify monitoring directory)

from kratos.

dosubot avatar dosubot commented on May 24, 2024

🤖

Hello @banfg56,

Nice to meet you! I'm Dosu, a bot here to help with issues related to the Kratos repository. I'm here to assist you with bugs, answer your questions, and guide you on how to become a contributor. While we wait for a human maintainer, feel free to ask me anything. Let's get your issue sorted out together!

您的问题与我在Kratos存储库中找到的一个已解决的问题有些相似。在这个问题配置文件加载如果是文件夹,更新配置重新加载则会报错中,建议的解决方案是避免使用在修改配置文件时会创建临时文件的编辑器。相反,应使用不会创建临时文件的编辑器,如Goland IDE。此外,在修改配置文件之前,确保删除任何现有的临时文件(如yaml~)。

关于您提出的改进建议:

  1. 配置加载时允许指定配置文件格式,比如:json 、ini等:这是一个很好的建议,可以提高Kratos的灵活性和用户体验。然而,作为一个AI,我无法创建拉取请求或问题。我建议您直接在Kratos存储库中提出这个建议。

  2. .swp类型文件记载规则保持一致:这个问题应该可以通过避免使用会创建临时文件的编辑器来解决。如果您仍然遇到问题,我建议您提供更多的信息,如错误消息和您的配置文件,以便我能更好地帮助您。

希望这些信息对您有所帮助。如果您有任何其他问题或需要进一步的澄清,请随时告诉我。

Sources

from kratos.

shenqidebaozi avatar shenqidebaozi commented on May 24, 2024

@banfg56 This suggestion looks good. We can add a configuration item in the file source to specify which suffixes are allowed to read files. Can you complete it?

from kratos.

CcCJeaz avatar CcCJeaz commented on May 24, 2024

kindly to ask if there is somebody working for this issue? If not, I'm glad to undertake it @shenqidebaozi

from kratos.

shenqidebaozi avatar shenqidebaozi commented on May 24, 2024

@CcCJeaz ok

from kratos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.