methods to reload service ? - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: methods to reload service ? (/showthread.php?tid=232331) |
methods to reload service ? - reaven - 2015-07-16 just wondering what methods exist to reload a service based Code: onSettingsChanged() Thanks ! RE: methods to reload service ? - el_Paraguayo - 2015-07-16 I've probably been doing it all wrong (so I'll be interested in any other answers to this thread!) but my approach was that I didn't want to restart the service, instead, I wanted the new settings to have effect from that point. All I ended up doing was just reloading the settings in the service loop and updating variables as necessary. It's not big, it's not clever, but it works for me. RE: methods to reload service ? - ronie - 2015-07-16 here's what i use to load new settings: PHP Code: class Main: RE: methods to reload service ? - el_Paraguayo - 2015-07-17 Maybe it's time to change my code... That's far more professional than my "solution"! Thanks for sharing, ronie. RE: methods to reload service ? - reaven - 2015-07-19 thank ronie, I would try that ! I would think there was a kodi method to do that like Ex.(made up) Code: xbmc.Addon().reloadAddon() RE: methods to reload service ? - maikito26 - 2015-09-10 Need some help. I can't seem to get Kodi to recognize settings being changed. There doesn't seem to be an event created when they change. I've called the onSettingsChanged() routine directly and it works so there shouldn't be an error its getting caught on. The main program just chugs along and there aren't any logs written from the restart routine. Any ideas what I might be doing wrong? Here's the code below. Code: class Main: RE: methods to reload service ? - maikito26 - 2015-09-12 I'll post this here for other people. I solve my problem. In the main code I was threading. In each of those threads they looped. But the main thread ends so I had to add a loop that doesn't do anything at the end of the code to keep the monitor alive to act on settings changes. I figured it out on a fluke when I accidentally killed the thread initializing. Code: class Main: |