Index: openacs-4/packages/xotcl-request-monitor/tcl/throttle_mod-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-request-monitor/tcl/throttle_mod-init.tcl,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/xotcl-request-monitor/tcl/throttle_mod-init.tcl 7 Aug 2017 23:48:30 -0000 1.8 +++ openacs-4/packages/xotcl-request-monitor/tcl/throttle_mod-init.tcl 4 Aug 2018 18:55:48 -0000 1.9 @@ -15,15 +15,34 @@ ad_register_filter -priority 1000 postauth POST * throttle } -# check if we are running under oacs; if not, provide -# minimal compatibility code +# +# Check if we are running under OpenACS; if not, provide +# minimal compatibility code. +# if {[info commands ad_conn] eq ""} { - # otherwise provide alias for ad_conn and dummy for ad_get_user_id + # + # Otherwise provide alias for "ad_conn" + # interp alias {} ad_conn {} ns_conn - ### this is probably not sufficient to do something useful... } +# +# When activity tracking is on, and we have a recent version of +# NaviServer, then "::xo::job_dequeue" is defined. We define a +# scheduled proc that runs every 61 seconds the executes the collected +# cmd in the background. This version produces substantially less locks +# on busy servers and reduces latency for the client. +# +set do_track_activity [parameter::get_from_package_key \ + -package_key "xotcl-request-monitor" \ + -parameter do_track_activity \ + -default false] +if {$do_track_activity && [info commands ::xo::job_dequeue] ne ""} { + nsv_set request_monitor jobs {} + ad_schedule_proc -thread t 61 ::xo::job_dequeue +} + # Local variables: # mode: tcl # tcl-indent-level: 2