getConfig() not updating on file changes?

Discussion in 'Spigot Plugin Development' started by Simo389, May 7, 2015.

  1. So I need my plugin to read directly from a config file. By this I mean any changes within the file should update immediately.

    So if I have say text 'test 1' in the config, change it to 'test 2' and save it - when reading from getConfig() in-game this change should be reflected. But currently it isn't? I'm running the server on Ubuntu, and completely replacing the config file each time with the new value - how do I read directly from this? I don't want the cached value when the server is first started - I want the current up-to-date value.

    Do I need to create methods for this? Or do the default config methods have support for it?
     
  2. Delete Config, Re-Export Plugin, Reload/Restart Server Done. That Simple
     
    • Creative Creative x 1
  3. this.reloadConfig(); to update the cache.. then apply where needed. If you want the value read often, schedule a task and just update it. I personally use a /<plugin> reload command
     
    • Like Like x 2
    • Useful Useful x 1