diff options
author | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-05-19 07:01:24 +0000 |
---|---|---|
committer | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-05-19 07:01:24 +0000 |
commit | 2ce770e7e5817f8838fdaf7bc7eda2a8da972962 (patch) | |
tree | 4aa6306599d38b6af01c8495d6731a838944602e /lib/Multi/Maintenance.pm | |
parent | 8b72b6535a553f8751842369a3abc0016d18611e (diff) |
Too many changes to keep track of. See ChangeLog. (I should commit more often -.-)
git-svn-id: svn://vndb.org/vndb@13 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
Diffstat (limited to 'lib/Multi/Maintenance.pm')
-rw-r--r-- | lib/Multi/Maintenance.pm | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/Multi/Maintenance.pm b/lib/Multi/Maintenance.pm index 1f1a337e..d0aa4dbc 100644 --- a/lib/Multi/Maintenance.pm +++ b/lib/Multi/Maintenance.pm @@ -26,24 +26,18 @@ sub spawn { sub _start { $_[KERNEL]->alias_set('maintenance'); - $_[KERNEL]->call(core => register => qr/^maintenance((?: (?:all|vncache|ratings|prevcache|integrity|unkanime|logrotate))+)$/, 'cmd_maintenance'); + $_[KERNEL]->call(core => register => qr/^maintenance((?: (?:vncache|ratings|prevcache|integrity|unkanime|logrotate))+)$/, 'cmd_maintenance'); - # Perform all maintenance functions every day on 0:00 - $_[KERNEL]->post(core => addcron => '0 0 * * *', 'maintenance all'); - # rotate logs every 1st day of the month at 0:05 - $_[KERNEL]->post(core => addcron => '5 0 1 * *' => 'maintenance logrotate'); + # Perform some maintenance functions every day on 0:00 + $_[KERNEL]->post(core => addcron => '0 0 * * *', 'maintenance ratings integrity unkanime'); + # update caches and rotate logs every 1st day of the month at 0:05 + $_[KERNEL]->post(core => addcron => '5 0 1 * *' => 'maintenance vncache prevcache logrotate'); } sub cmd_maintenance { - local $_ = $_[ARG1]; - - $_[KERNEL]->yield('vncache') if /(?:vncache|all)/; - $_[KERNEL]->yield('ratings') if /(?:ratings|all)/; - $_[KERNEL]->yield('prevcache') if /(?:prevcache|all)/; - $_[KERNEL]->yield('integrity') if /(?:integrity|all)/; - $_[KERNEL]->yield('unkanime') if /(?:unkanime|all)/; - $_[KERNEL]->yield('logrotate') if /logrotate/; + $_[KERNEL]->yield($_) + for (split /\s+/, $_[ARG1]); $_[KERNEL]->post(core => finish => $_[ARG0]); } |