Forum OpenACS Development: edit API

Collapse
Posted by Iuri Sampaio on
is there a way to edit proc and make them effective without restart aolserver?
Collapse
2: Re: edit API (response to 1)
Posted by Dave Bauer on
You can try this which should work as long as you have the latest version of XoTcl (not the openacs apckage, but the Tcl library).

ns_eval {source /home/openacs/packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl}

where the path is the path to the tcl file that contains the procs you want to reload. This reloads in all threads included scheduled procs.

In older versions of xotcl this would cause problems with the database procedures so if you try this and you immediately get database errors you'll have to upgrade xotcl (and restart aolserver to restore the state of the tcl interpreters.)

Collapse
3: Re: edit API (response to 2)
Posted by Gustaf Neumann on
In most situation, there is no need to use ns_eval; one can go to /acs-admin/apm and click on "reload changed".

There are cases, where "reload changed" does not work (when e.g. PerformanceModeP is activated; per default, performance mode is not activated. we don't set PerformanceModeP even on our production systems). If for some reason, you have to activate the performance mode, "reload changed does not work amd one has to use ns_eval, as Dave pointed out. There are combinations of xotcl-core and XOTcl, where ns_eval caused problems. For some more details, check https://openacs.org/forums/message-view?message_id=1567233
Option (c) of my posting is implemented in xotcl 1.6.1, the latest release (since nov) is 1.6.2.

Note, that reloading of procs does not work for scheduled procedures running in own threads. This has nothing to do with xotcl, but with the way how the scheduled procs are implemented.

Hope this helps
-gustaf neumann

Collapse
4: Re: edit API (response to 3)
Posted by Iuri Sampaio on
Yes it helped. Both of replies! thanks

the bottom line is:
1. If you are testing a scheduled procedure among all its callbacks then you must restart.

2. To the rest just use admin interface acs-admin/apm. with newest verson of XoTCL installed.