Index: openacs-4/packages/xotcl-core/xotcl-core.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/xotcl-core.info,v
diff -u -N -r1.106.2.23 -r1.106.2.24
--- openacs-4/packages/xotcl-core/xotcl-core.info 26 Aug 2020 18:34:59 -0000 1.106.2.23
+++ openacs-4/packages/xotcl-core/xotcl-core.info 21 Oct 2020 17:47:06 -0000 1.106.2.24
@@ -10,7 +10,7 @@
t
xotcl
-
+
Gustaf Neumann
XOTcl library functionality (e.g. thread handling, online documentation, Generic Form and List Classes)
2017-08-06
@@ -42,7 +42,7 @@
BSD-Style
2
-
+
Index: openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl,v
diff -u -N -r1.93.2.28 -r1.93.2.29
--- openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl 17 Oct 2020 19:03:58 -0000 1.93.2.28
+++ openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl 21 Oct 2020 17:47:06 -0000 1.93.2.29
@@ -485,6 +485,21 @@
#
set ::xo::rss 0 ;# set it to one to activate it
+ #
+ # Experimental low-level cleanup handlers, which are similar to
+ # ::xo::cleanup, but which survive per-request cleanup and which
+ # have to be manually deregistered.
+ #
+ proc add_cleanup {key cmd} {
+ set ::xo::cleanup_always($key) $cmd
+ }
+ proc remove_cleanup {key} {
+ unset ::xo::cleanup_always($key)
+ }
+
+ #
+ # Per-request cleanup handler.
+ #
proc at_cleanup {args} {
::xo::dc profile off
::xo::broadcast receive
@@ -498,7 +513,7 @@
if {[file readable /proc/[pid]/statm]} {
set F [open /proc/[pid]/statm]; set c [read $F]; close $F
lassign $c size rss shared
- set size [format %.2f [expr {$rss*4.096/1048576}]]
+ set size [format %.2f [expr {$rss * 4.096 / 1048576}]]
if {$::xo::rss != $size} {
ns_log notice "=== RSS size change to: $size GB"
set ::xo::rss $size
@@ -508,7 +523,7 @@
#ns_log notice "*** start of cleanup <$args> ([array get ::xo::cleanup])"
set at_end ""
- foreach {name cmd} [array get ::xo::cleanup] {
+ foreach {name cmd} [list {*}[array get ::xo::cleanup] {*}[array get ::xo::cleanup_always]] {
#::trace remove variable ::xotcl_cleanup($name) unset ::xo::cleanup
if {![nsf::is object $name]} {
#ns_log notice "--D $name already destroyed, nothing to do"
@@ -850,7 +865,7 @@
foreach cmd [nsv_get broadcast $tid] {
ns_log notice "broadcast received {$cmd}"
try {
- {*}$cmd
+ eval $cmd
} on error {errorMsg} {
ns_log notice "broadcast receive error: $errorMsg for cmd $cmd"
}
Index: openacs-4/packages/xowf/xowf.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/xowf.info,v
diff -u -N -r1.12.2.21 -r1.12.2.22
--- openacs-4/packages/xowf/xowf.info 2 Oct 2020 11:25:08 -0000 1.12.2.21
+++ openacs-4/packages/xowf/xowf.info 21 Oct 2020 17:47:06 -0000 1.12.2.22
@@ -10,16 +10,16 @@
t
xowf
-
+
Gustaf Neumann
XoWiki Content Flow - an XoWiki based workflow system implementing state-based behavior of wiki pages and forms
2017-08-06
WU Vienna
2
-
+
-
+
Index: openacs-4/packages/xowf/tcl/xowf-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/tcl/xowf-procs.tcl,v
diff -u -N -r1.28.2.43 -r1.28.2.44
--- openacs-4/packages/xowf/tcl/xowf-procs.tcl 1 Oct 2020 15:59:38 -0000 1.28.2.43
+++ openacs-4/packages/xowf/tcl/xowf-procs.tcl 21 Oct 2020 17:47:06 -0000 1.28.2.44
@@ -251,6 +251,24 @@
}
}
+ WorkflowContainer instproc init {} {
+ set :creation_time [clock seconds]
+ ::xo::add_cleanup [self] [list [self] cleanup]
+ next
+ }
+
+ WorkflowContainer instproc cleanup {} {
+ #
+ # Keep workflow container 10 minutes in the per-thread cache.
+ #
+ if {[clock seconds] - ${:creation_time} > 600} {
+ ns_log notice "======================== WorkflowContainer [self] self destroys"
+ ::xo::remove_cleanup [self]
+ :destroy
+ }
+ }
+
+
WorkflowContainer instproc object {} {
#
# Method for emulating "object". Object specific code cannot