clearCachedModules
Syntax
clearCachedModules()
Arguments
None
Details
Clear all cached modules. After updating a module, execute this command to clear the cached module data. When you call the module via use
, the system reloads it from the module file instead of using the cached data, and there is no need to restart the node.
Note: Only administrators can execute this command.
Examples
Define a module.
$ module printLog
$ def printLog(){
$ print "hello"
$ }
Load the module.
$ use printLog
$ printLog()
hello
Update the module.
$ module printLog
$ def printLog(){
$ print "hello new"
$ }
Before loading the updated module, call clearCachedModules
to clear the cached module.
$ login("admin", "123456")
$ clearCachedModules();
$ use printLog
$ printLog()
hello new