add expire_jobs and set default expire times

This commit is contained in:
Oliver Gorwits
2014-09-27 11:31:37 +01:00
parent f8e1507069
commit 4a6081fc58
4 changed files with 35 additions and 6 deletions

View File

@@ -1,3 +1,14 @@
2.029009 - 2014-09-27
[ENHANCEMENTS]
* Defaults now exist for all expire tasks
* Added expire_jobs to remove jobs queue items after 14 days
[BUG FIXES]
* Require new DBIC version to fix duplicate DB connection problem
2.029008 - 2014-09-23
[ENHANCEMENTS]

View File

@@ -40,6 +40,15 @@ sub expire {
});
}
if (setting('expire_jobs') and setting('expire_jobs') > 0) {
schema('netdisco')->txn_do(sub {
schema('netdisco')->resultset('Admin')->search({
entered => \[q/< (now() - ?::interval)/,
(setting('expire_jobs') * 86400)],
})->delete();
});
}
return job_done("Checked expiry for all Devices and Nodes");
}

View File

@@ -724,14 +724,14 @@ seconds as well as integers.
=head3 C<expire_devices>
Value: Number of Days.
Value: Number of Days. Default: 60
Devices that have not been refreshed in this number of days will be removed.
All nodes connected to this device will be removed as well.
=head3 C<expire_nodes>
Value: Number of Days.
Value: Number of Days. Default: 90
Nodes that have not been refreshed in this number of days will be removed from
the database. Archived and non-archived nodes are removed. This includes
@@ -739,11 +739,19 @@ SwitchPort/MAC and MAC/IP mappings.
=head3 C<expire_nodes_archive>
Value: Number of Days.
Value: Number of Days. Default: 60
Archived data for switch-port/MAC and MAC/IP mappings older than this number
of days will be removed.
=head3 C<expire_jobs>
Value: Number of Days. Default: 14
Jobs which entered the job queue more than this many days ago will be removed
from the queue during the scheduled expiry process (regardless of whether they
were ever run).
=head3 C<dns>
Value: Settings Tree. Default:

View File

@@ -130,9 +130,10 @@ nbtstat_only: []
nbtstat_max_age: 7
nbtstat_interval: 0.02
nbtstat_timeout: 1
expire_devices: 0
expire_nodes: 0
expire_nodes_archive: 0
expire_devices: 60
expire_nodes: 90
expire_nodes_archive: 60
expire_jobs: 14
store_wireless_clients: true
store_modules: true
ignore_interfaces: