Cached Code?

I'm trying to create a Plex Channel Plugin, but it seems like my code is being cached somewhere and always executed. Obviously, this makes it a pain to iterate. I've done simple things like change:

Log.Debug("This is an old message")

to

Log.Debug("this is a new message")

expecting that when I refresh the page I'll see my new log message, but I keep seeing the old log message show up in my log. Any help here is appreciated.

 

Channels / agents should be reloaded automatically when you change code (look at the log in PMS Plugins/... to see). Could it be the caching is on the client side?

Also of note is that PMS should reload the plugin when it detects a change in the filesystem.  Depending on what you're using to edit your files I've seen this be quite hit and miss (dependant on OS as well, etc).  For example when I use SFTP to edit a file on my dev server PMS doesn't always pick up a change and restart it.  Sometimes I'll try adding an extra carriage return or two and saving again.  If you watch the log files with something like Console.app on OSX you'll see when it reloads.  Worst case if it doesn't reload you can manually stop and restart PMS (not ideal but sometimes you have to do what you have to do).

Also as elan said above, what client are you using to test with?  If it's Plex/Web I would suggest using something different.  Lots of potential for things to stay stuck in cache with Plex/Web.  If this instance if you're watching log files and seeing the same lines from Log.Debug I don't think that's the issue here, but it might be the next one you run into ;)

Just adding my two cents: in my experience Plex sometimes didn't recognize when I've made changes to some Shared Code (*.pys) files, I had to restart the server. No idea what exactly caused those issues but it sure was frustrating. The Code/__init__.py and such haven't ever given me any trouble though.

The pys files I've seen before I think it's either expected behaviour and/or a known issue.  You're meaning editing a Service file?  I think that's the only place you should be using *.pys files ...

I meant those used like SharedCodeService.service_name.do_something() (example here). I recall that an almost sure way to reproduce was to leave a syntax error in a *.pys file and make a call to that code, then it would stay there until PMS restart. If it's a known issue then not all hope is lost I guess :)

Not sure if the same happens for URL Services *.pys files, mine are not very large, maybe I just haven't edited it enough to encounter the issue.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.