summaryrefslogtreecommitdiff
path: root/lib/VNDB/Util/Misc.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-07-23 16:22:47 +0200
committerYorhel <git@yorhel.nl>2009-07-23 16:22:47 +0200
commit91b95b0bbf17a5756e5a7da4649f82f5a9184975 (patch)
tree03c5d8b88eb150c0043f374c9429b7fce68179a0 /lib/VNDB/Util/Misc.pm
parent2ca3c8ed395490090e134883a3a364336fd62d77 (diff)
Implemented relgraph notify from PgSQL trigger
This finishes the new relation graph generator, as it'll now regenerate graphs as soon as is needed. This obsletes the VNDB::Util::Misc::vnCacheUpdate() function, this functionality is provided by triggers within PostgreSQL. The update_vncache(0) procedure is now significantly slower due to the trigger on the vn table. It'd be a good idea to rewrite this procedure by using triggers and conditional updates, to drastically lower the number of rows that need to be updated.
Diffstat (limited to 'lib/VNDB/Util/Misc.pm')
-rw-r--r--lib/VNDB/Util/Misc.pm22
1 files changed, 2 insertions, 20 deletions
diff --git a/lib/VNDB/Util/Misc.pm b/lib/VNDB/Util/Misc.pm
index 139eb571..f4eb5a7c 100644
--- a/lib/VNDB/Util/Misc.pm
+++ b/lib/VNDB/Util/Misc.pm
@@ -6,7 +6,7 @@ use warnings;
use Exporter 'import';
use Tie::ShareLite ':lock';
-our @EXPORT = qw|multiCmd vnCacheUpdate|;
+our @EXPORT = qw|multiCmd|;
# Sends a command to Multi
@@ -28,23 +28,5 @@ sub multiCmd {
}
-# Recalculates the vn.c_* columns and regenerates the related relation graphs on any change
-# Arguments: list of vids to be updated
-sub vnCacheUpdate {
- my($self, @vns) = @_;
-
- my $before = $self->dbVNGet(id => \@vns, order => 'v.id', what => 'relations');
- $self->dbVNCache(@vns);
- my $after = $self->dbVNGet(id => \@vns, order => 'v.id');
-
- my @upd = map {
- @{$before->[$_]{relations}} && (
- $before->[$_]{c_released} != $after->[$_]{c_released}
- || $before->[$_]{c_languages} ne $after->[$_]{c_languages}
- ) ? $before->[$_]{id} : ();
- } 0..$#$before;
- $self->multiCmd('relgraph '.join(' ', @upd)) if @upd;
-}
-
-
1;
+