ds_sweep_data (private)

 ds_sweep_data

Defined in packages/acs-developer-support/tcl/acs-developer-support-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
%3 ds_instance_id ds_instance_id (private) parameter::get parameter::get (public) ds_sweep_data ds_sweep_data ds_sweep_data->ds_instance_id ds_sweep_data->parameter::get

Testcases:
No testcase defined.
Source code:
    set now [ns_time]
    set lifetime [parameter::get -package_id [ds_instance_id] -parameter DataLifetime -default 900]

    # Find the last request before the DataLifetime cutoff

    set names [nsv_array names ds_request]
    set max_request 0
    foreach name $names {
        if { [regexp {^([0-9]+)\.start$} $name match request]
             && $now - [lindex [nsv_get ds_request $name] 0] > $lifetime } {
            if {$request > $max_request} {
                set max_request $request
            }
        }
    }

    # kill any request older than last request.

    set kill_count 0
    foreach name $names {
        if { [regexp {^([0-9]+)\.} $name "" request]
             && $request <= $max_request
         } {
            incr kill_count
            nsv_unset ds_request $name
        }
    }

    ns_log "Debug" "Swept developer support information for [array size kill_requests] requests ($kill_count nsv elements)"
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: