diff options
author | Yorhel <git@yorhel.nl> | 2009-07-18 20:53:23 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-07-18 20:53:23 +0200 |
commit | 4df0638b6f615489bd946c03753b3bbe0269e3b2 (patch) | |
tree | 4c2ede71b3902d9f4b6a9df7d32479107ba12681 /lib | |
parent | ae53633780260b152a105c83fb4a7a72cd82d33b (diff) |
Notify Multi::Image for new cover images via LISTEN/NOTIFY
Yay! Another weird shared-memory-command optimized away. And the image
resizer reacts a lot faster now. Noticably, even.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Multi/Image.pm | 2 | ||||
-rw-r--r-- | lib/VNDB/Handler/VNEdit.pm | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/Multi/Image.pm b/lib/Multi/Image.pm index c3a0d04f..a0c27a51 100644 --- a/lib/Multi/Image.pm +++ b/lib/Multi/Image.pm @@ -36,12 +36,14 @@ sub spawn { sub _start { $_[KERNEL]->alias_set('image'); $_[KERNEL]->sig(shutdown => 'shutdown'); + $_[KERNEL]->post(pg => listen => coverimage => 'cv_check'); $_[KERNEL]->yield('cv_check'); $_[KERNEL]->yield('scr_check'); } sub shutdown { + $_[KERNEL]->post(pg => unlisten => 'coverimage'); $_[KERNEL]->delay('cv_check'); $_[KERNEL]->delay('scr_check'); } diff --git a/lib/VNDB/Handler/VNEdit.pm b/lib/VNDB/Handler/VNEdit.pm index 8e4de7ec..9fb276a6 100644 --- a/lib/VNDB/Handler/VNEdit.pm +++ b/lib/VNDB/Handler/VNEdit.pm @@ -130,12 +130,11 @@ sub _uploadimage { return undef; } - # store the file and let multi handle it + # get image ID and move it to the correct location my $imgid = $self->dbVNImageId; my $new = sprintf '%s/static/cv/%02d/%d.jpg', $VNDB::ROOT, $imgid%100, $imgid; rename $tmp, $new or die $!; chmod 0666, $new; - $self->multiCmd("coverimage $imgid"); return -1*$imgid; } |