summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-08-05 15:44:35 +0200
committerYorhel <git@yorhel.nl>2009-08-05 15:44:35 +0200
commit4cb49d6a28a0392fbd9a50c39a350ce3cf4b5521 (patch)
treed040956bd4547bc6e7f547065f8e502f751903db
parente8a58a755ad484a07da3832651cbce18a602bf4d (diff)
Removed last traces of the shared memory processing queue
Everything has now finally been converted to use the PgSQL LISTEN/NOTIFY feature. This commit removes the last Tie::ShareLite dependency.
-rw-r--r--lib/VNDB/Handler/Discussions.pm2
-rw-r--r--lib/VNDB/Handler/Producers.pm2
-rw-r--r--lib/VNDB/Handler/Releases.pm1
-rw-r--r--lib/VNDB/Handler/Tags.pm1
-rw-r--r--lib/VNDB/Handler/VNEdit.pm6
-rw-r--r--lib/VNDB/Util/Misc.pm32
-rwxr-xr-xutil/vndb.pl8
7 files changed, 0 insertions, 52 deletions
diff --git a/lib/VNDB/Handler/Discussions.pm b/lib/VNDB/Handler/Discussions.pm
index eff8212e..1ec79c18 100644
--- a/lib/VNDB/Handler/Discussions.pm
+++ b/lib/VNDB/Handler/Discussions.pm
@@ -206,8 +206,6 @@ sub edit {
$self->dbPostEdit($tid, $num, %post) if $num;
$nnum = $self->dbPostAdd($ntid, %post) if !$num;
- $self->multiCmd("ircnotify t$ntid.$nnum") if !$num && !$frm->{hidden};
-
return $self->resRedirect("/t$ntid".($nnum > 25 ? '/'.ceil($nnum/25) : '').'#'.$nnum, 'post');
}
}
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm
index 5977ac1e..aa010e6e 100644
--- a/lib/VNDB/Handler/Producers.pm
+++ b/lib/VNDB/Handler/Producers.pm
@@ -121,8 +121,6 @@ sub edit {
($pid) = $self->dbProducerAdd(%$frm);
}
- $self->multiCmd("ircnotify p$pid.$rev");
-
return $self->resRedirect("/p$pid.$rev", 'post');
}
}
diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm
index f2791cb1..db234aea 100644
--- a/lib/VNDB/Handler/Releases.pm
+++ b/lib/VNDB/Handler/Releases.pm
@@ -354,7 +354,6 @@ sub edit {
($rev) = $self->dbReleaseEdit($rid, %opts) if !$copy && $rid;
($rid) = $self->dbReleaseAdd(%opts) if $copy || !$rid;
- $self->multiCmd("ircnotify r$rid.$rev");
$self->dbVNCache(@$new_vn, map $_->{vid}, @$vn);
return $self->resRedirect("/r$rid.$rev", 'post');
diff --git a/lib/VNDB/Handler/Tags.pm b/lib/VNDB/Handler/Tags.pm
index 6471d44f..dfcd041d 100644
--- a/lib/VNDB/Handler/Tags.pm
+++ b/lib/VNDB/Handler/Tags.pm
@@ -279,7 +279,6 @@ sub tagedit {
);
if(!$tag) {
$tag = $self->dbTagAdd(%opts);
- $self->multiCmd("ircnotify g$tag");
} else {
$self->dbTagEdit($tag, %opts, upddate => $frm->{state} == 2 && $t->{state} != 2);
}
diff --git a/lib/VNDB/Handler/VNEdit.pm b/lib/VNDB/Handler/VNEdit.pm
index 959e5342..2b6e4ac5 100644
--- a/lib/VNDB/Handler/VNEdit.pm
+++ b/lib/VNDB/Handler/VNEdit.pm
@@ -87,12 +87,8 @@ sub edit {
my %old = $vid ? (map { $_->{id} => $_->{relation} } @{$v->{relations}}) : ();
my %new = map { $_->[1] => $_->[0] } @$relations;
_updreverse($self, \%old, \%new, $nvid, $cid, $nrev);
- } elsif($vid && @$relations && $frm->{title} ne $b4{title}) {
- $self->multiCmd("relgraph $vid");
}
- $self->multiCmd("ircnotify v$nvid.$nrev");
-
return $self->resRedirect("/v$nvid.$nrev", 'post');
}
}
@@ -298,8 +294,6 @@ sub _updreverse {
( map { $_ => $r->{$_} } qw| title original desc alias categories img_nsfw length l_wp l_encubed l_renai l_vnn image | )
);
}
-
- $self->multiCmd('relgraph '.join(' ', $vid, keys %upd));
}
diff --git a/lib/VNDB/Util/Misc.pm b/lib/VNDB/Util/Misc.pm
deleted file mode 100644
index f4eb5a7c..00000000
--- a/lib/VNDB/Util/Misc.pm
+++ /dev/null
@@ -1,32 +0,0 @@
-
-package VNDB::Util::Misc;
-
-use strict;
-use warnings;
-use Exporter 'import';
-use Tie::ShareLite ':lock';
-
-our @EXPORT = qw|multiCmd|;
-
-
-# Sends a command to Multi
-# Argument: the commands to add to the queue, or none to send the queue to Multi
-sub multiCmd {
- my $self = shift;
-
- $self->{_multiCmd} = [] if !$self->{_multiCmd};
- return push @{$self->{_multiCmd}}, @_ if @_;
-
- return if !@{$self->{_multiCmd}};
-
- my $s = tie my %s, 'Tie::ShareLite', -key => $self->{sharedmem_key}, -create => 'yes', -destroy => 'no', -mode => 0666;
- $s->lock(LOCK_EX);
- my @q = ( ($s{queue} ? @{$s{queue}} : ()), @{$self->{_multiCmd}} );
- $s{queue} = \@q;
- $s->unlock();
- $self->{_multiCmd} = [];
-}
-
-
-1;
-
diff --git a/util/vndb.pl b/util/vndb.pl
index 8a9a83e5..455a1c23 100755
--- a/util/vndb.pl
+++ b/util/vndb.pl
@@ -36,7 +36,6 @@ YAWF::init(
namespace => 'VNDB',
object_data => \%S,
pre_request_handler => \&reqinit,
- post_request_handler => \&reqdone,
error_404_handler => \&handle404,
);
@@ -58,13 +57,6 @@ sub reqinit {
}
-sub reqdone {
- my $self = shift;
- $self->dbCommit;
- $self->multiCmd;
-}
-
-
sub handle404 {
my $self = shift;
$self->resStatus(404);