nsmcp::AccessRecordStoreSQLite method prune (public)

 <instance of nsmcp::AccessRecordStoreSQLite[i]> prune

Defined in /usr/local/ns/tcl/nsmcp/log-traffic-record-store.tcl

Testcases:
No testcase defined.
Source code:
if {[dict exists ${:settings} unified] && [dict get ${:settings} unified]} {return [:pruneAge]}

# Expire whole source generations, not individual rows/ranges: keeping
# a range after deleting its rows would falsely certify cached coverage.
set cutoff [expr {[clock seconds]-[dict get ${:settings} retention]}]
${:db} transaction {
    ${:db} execute {DELETE FROM nsmcp_records.rows WHERE fid IN (SELECT fid FROM nsmcp_records.files WHERE touched<$cutoff);
        DELETE FROM nsmcp_records.ranges WHERE fid IN (SELECT fid FROM nsmcp_records.files WHERE touched<$cutoff);
        DELETE FROM nsmcp_records.files WHERE touched<$cutoff}
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: