summaryrefslogtreecommitdiff
path: root/lib/POE/Component/Pg.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/POE/Component/Pg.pm')
-rw-r--r--lib/POE/Component/Pg.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/POE/Component/Pg.pm b/lib/POE/Component/Pg.pm
index a68966b..a31b6b5 100644
--- a/lib/POE/Component/Pg.pm
+++ b/lib/POE/Component/Pg.pm
@@ -296,13 +296,16 @@ sub dbi_canwrite {
$_[HEAP]{q}->execute($item->[QPARAM] && ref($item->[QPARAM]) eq 'ARRAY' ? @{$item->[QPARAM]} : ());
};
+ # no need to write anymore
+ $_[KERNEL]->select_pause_write($_[HEAP]{fh});
+
# send error or enter read state
if($@) {
sendevent \@_, 'error', $item->[QACT], $@, $item->[QQUERY], $item->[QPARAM], $item->[QSESID], $item->[QARG];
+ shift @{$_[HEAP]{queue}};
$_[KERNEL]->call($_[SESSION], 'process_queue');
} else {
$_[HEAP]{state} = 2;
- $_[KERNEL]->select_pause_write($_[HEAP]{fh});
}
}