diff options
author | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-06-30 20:24:34 +0000 |
---|---|---|
committer | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-06-30 20:24:34 +0000 |
commit | 59276c24a03e688794701537a2ffded8f9c3680e (patch) | |
tree | 494a06545c3875e0e6607590ecd72659163171ad /lib | |
parent | 29d64245529b7a3e95f9059f785bb206fc70f570 (diff) |
Small prev -> rev fix, and removed unnesessary $prep in Multi's replies
git-svn-id: svn://vndb.org/vndb@50 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Multi/IRC.pm | 4 | ||||
-rw-r--r-- | lib/Multi/Maintenance.pm | 13 |
2 files changed, 9 insertions, 8 deletions
diff --git a/lib/Multi/IRC.pm b/lib/Multi/IRC.pm index 34d4ccd2..2c95ddc9 100644 --- a/lib/Multi/IRC.pm +++ b/lib/Multi/IRC.pm @@ -127,9 +127,9 @@ sub irccmd { # dest, cmd, [nick], [prep] $_[KERNEL]->post(circ => ctcp => $_[HEAP]{o}{channel}, "ACTION $1"); } elsif($cmd =~ /^cmd (.+)$/) { $_[KERNEL]->post(core => queue => $1); - $_[KERNEL]->post(circ => privmsg => $dest => sprintf "%sExecuting command '%s'", $prep, $1); + $_[KERNEL]->post(circ => privmsg => $dest => sprintf "Executing command '%s'", $1); } elsif($cmd =~ /^eval (.+)$/) { - $_[KERNEL]->post(circ => privmsg => $dest, $prep.'eval: '.$_) + $_[KERNEL]->post(circ => privmsg => $dest, 'eval: '.$_) for (split /\r?\n/, eval($1)||$@); } else { $_[KERNEL]->post(circ => privmsg => $dest, $prep.'Unkown command'); diff --git a/lib/Multi/Maintenance.pm b/lib/Multi/Maintenance.pm index ef49340b..93734473 100644 --- a/lib/Multi/Maintenance.pm +++ b/lib/Multi/Maintenance.pm @@ -18,7 +18,7 @@ sub spawn { my $p = shift; POE::Session->create( package_states => [ - $p => [qw| _start cmd_maintenance vncache ratings prevcache integrity unkanime logrotate |], + $p => [qw| _start cmd_maintenance vncache ratings revcache integrity unkanime logrotate |], ], ); } @@ -26,12 +26,12 @@ sub spawn { sub _start { $_[KERNEL]->alias_set('maintenance'); - $_[KERNEL]->call(core => register => qr/^maintenance((?: (?:vncache|ratings|prevcache|integrity|unkanime|logrotate))+)$/, 'cmd_maintenance'); + $_[KERNEL]->call(core => register => qr/^maintenance((?: (?:vncache|ratings|revcache|integrity|unkanime|logrotate))+)$/, 'cmd_maintenance'); # Perform some maintenance functions every day on 0:00 $_[KERNEL]->post(core => addcron => '0 0 * * *', 'maintenance vncache 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 prevcache logrotate'); + $_[KERNEL]->post(core => addcron => '5 0 1 * *' => 'maintenance revcache logrotate'); } @@ -55,10 +55,11 @@ sub ratings { } -sub prevcache { - $_[KERNEL]->call(core => log => 3 => 'Updating prev column in the changes table...'); +sub revcache { + $_[KERNEL]->call(core => log => 3 => 'Updating rev column in the changes table...'); # this can take a while, maybe split these up in 3 queries? - $Multi::SQL->do(q|SELECT update_prev('vn', ''), update_prev('releases', ''), update_prev('producers', '')|); + # ...or better yet, use asynchronous communication with PgSQL + $Multi::SQL->do(q|SELECT update_rev('vn', ''), update_rev('releases', ''), update_rev('producers', '')|); } |