external module refreshing

LabKey Support Forum (Inactive)
external module refreshing martin  2014-11-12 02:05
Status: Closed
 
Hi,

I created an external HTML+javascript module and it displays and works ok, however, when i make a simple change in my .html file, it doesn't automatically refresh on the server.

this seems unusual because when i tried this on other installation of labkey server it updated really quickly

the only difference i can think of is that my server (14.1) runs on ubuntu while the other one (14.2) runs on windows

do you have any suggestions?
restarting tomcat helps to solve it, but i really can't afford to do it that often.

thanks,

martin
 
 
jeckels responded:  2014-11-12 19:37
Hi Martin,

We have been making changes to improve how the server notices new resources, like HTML files. It's possible that newer versions will pick things up automatically while older versions would not.

Where is your module located, relative to the "modules" that contains the standard set of modules? Are you doing any kind of Ant build or other steps to deploy it?

Another difference may be whether you're running your server in development or production mode. Production servers are more aggressive in caching resources for performance. This is controlled with a -Ddevmode=true option during Tomcat startup. For more details, see the "Configure LabKey Development/Debug Configuration" section here:

https://www.labkey.org/wiki/home/Documentation/page.view?name=build

You can check the mode of the server in the Admin Console.

Thanks,
Josh
 
martin responded:  2014-11-13 01:01
Thank you very much,

i'm running server in a production mode, however the other one runs in a production mode too.

my module is located in <labkey_home>/exernalModules
and has this structure:

-module name
->resources
-->config (contains module.xml)
-->views (contains begin.html AND [module_name].webpart.xml)
->web (contains jquery libraries)

i deploy modules simply by copying them to externalModules folder and then the server automatically restarts
(if i understood you question correctly)

i updated server to 14.2. but it still doesn't automatically update content of the module.

isn't there an option to configure module refresh rate explicitly?

martin
 
adam responded:  2014-11-13 07:57
No, there is no option like that. We are moving to a model where all module-defined resources (HTML views, custom views, queries, reports, schema meta data XML, etc.) are consistently cached for performance but immediately refreshed when changed in the file system, regardless of server mode. (The Java 7 WatchService is the key enhancement that enables the new approach.) The conversion is time consuming and none of our clients has prioritized the work at the top of their list, so this may not appear for a couple releases. Let us know if you'd like to help us accelerate the process.

In the mean time, you can always clear the server cache to force reload of all cached module resources after you change them. Admin Console -> Caches -> Clear Caches and Refresh.

Adam
 
martin responded:  2014-11-13 08:38
thank you, this solution works just fine

best regards

martin