summaryrefslogtreecommitdiff
path: root/util/multi.pl
diff options
context:
space:
mode:
authoryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-06-06 15:33:01 +0000
committeryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-06-06 15:33:01 +0000
commit8ca9a520d993d0a1a8b7bbcd800b68bf7543b7c3 (patch)
tree1db0d1842a67ed0da169e02e6ade4b3324ad117f /util/multi.pl
parentd667908bb47626b789344048537b3eb9e00d6828 (diff)
Removed old stuff and passwords. All passwords in older revisions have been changed :)
git-svn-id: svn://vndb.org/vndb@22 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
Diffstat (limited to 'util/multi.pl')
-rw-r--r--util/multi.pl21
1 files changed, 8 insertions, 13 deletions
diff --git a/util/multi.pl b/util/multi.pl
index d45150fb..9a072d02 100644
--- a/util/multi.pl
+++ b/util/multi.pl
@@ -25,12 +25,6 @@ use DBI;
use lib '/www/vndb/lib';
use Multi::Core;
-use Multi::RG;
-use Multi::Image;
-use Multi::Sitemap;
-use Multi::Anime;
-use Multi::Maintenance;
-use Multi::IRC;
BEGIN { require 'global.pl' }
@@ -50,20 +44,21 @@ if(grep /^-a$/, @ARGV) {
exit;
}
-
# one shared pgsql connection for all sessions
our $SQL = DBI->connect(@VNDB::DBLOGIN,
{ PrintError => 1, RaiseError => 0, AutoCommit => 1, pg_enable_utf8 => 1 });
Multi::Core->spawn();
-Multi::RG->spawn();
-Multi::Image->spawn();
-Multi::Sitemap->spawn();
-Multi::Anime->spawn() if !$VNDB::DEBUG; # no need to update anime from the beta
-Multi::Maintenance->spawn();
-Multi::IRC->spawn() if !$VNDB::DEBUG;
+# dynamically load and spawn modules
+for (0..(@$VNDB::MULTI/2+1)) {
+ my($mod, $args) = @{$VNDB::MULTI}[$_*2, $_*2+1];
+ next if !$args || ref($args) ne 'HASH';
+ require "Multi/$mod.pm";
+ # I'm surprised the strict pagma isn't complaining about this
+ "Multi::$mod"->spawn(%$args);
+}
$SIG{__WARN__} = sub {(local$_=shift)=~s/\r?\n//;$poe_kernel->call(core=>log=>1,'__WARN__: '.$_)};