Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #80 from doug-martin/master
Browse files Browse the repository at this point in the history
v0.2.8
  • Loading branch information
doug-martin committed Nov 14, 2013
2 parents 3c2e947 + 990c7f6 commit 1cabe63
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.2.8

* Updated listener to strip generated quotes.


# 0.2.7

* Fixed issue with quoted channel names
Expand Down
4 changes: 4 additions & 0 deletions docs/History.html
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,10 @@



<h1>0.2.8</h1>
<ul>
<li>Updated listener to strip generated quotes.</li>
</ul>
<h1>0.2.7</h1>
<ul>
<li>Fixed issue with quoted channel names</li>
Expand Down
8 changes: 7 additions & 1 deletion lib/adapters/postgres.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,11 +480,15 @@ var DB = define(Database, {
listen: function (channel, cb, opts) {
opts = opts || {};
channel = this.__quoteSchemaTable(channel);
var listeningChannel = channel.toLowerCase();
var timeout = opts.timeout || 30000,
loop = opts.loop || false,
ret = new Promise(),
connected = true;
var self = this;
if (this.quoteIdentifiers) {
listeningChannel = listeningChannel.replace(/^"|"$/g, "");
}
var connectionTimeout = setTimeout(function () {
if (!connected) {
ret.errback(new Error("Listen: Unable to connect to " + channel));
Expand All @@ -493,8 +497,10 @@ var DB = define(Database, {
this._getConnection().chain(function (conn) {
connected = true;
clearTimeout(connectionTimeout);


function __listener(message) {
if (message.channel === channel.toLowerCase()) {
if (message.channel === listeningChannel) {
cb(JSON.parse(message.payload));
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "patio",
"description": "Patio query engine and ORM",
"version": "0.2.7",
"version": "0.2.8",
"keywords": [
"ORM",
"object relation mapper",
Expand Down

0 comments on commit 1cabe63

Please sign in to comment.