Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watch-changes is faulty #36

Open
kzar opened this issue Nov 21, 2011 · 4 comments
Open

watch-changes is faulty #36

kzar opened this issue Nov 21, 2011 · 4 comments
Milestone

Comments

@kzar
Copy link

kzar commented Nov 21, 2011

I've noticed that the watch-changes feature doesn't always work.

With 0.2.5 I used it successfully on my development database running on the same machine but I was unable to use it in production with the database running on a separate machine.

With 0.3.0-SNAPSHOT I wasn't able to get it working on either a local development database or a remote production one.

In both cases the watch-changes function ran successfully and changes-error came back empty.

Here's a snippet showing what I did:

  (ns scratch.core
    (require [com.ashafa.clutch :as clutch]))

  (def prod-db "http://user:pass@remote-host/dbname")
  (def dev-db "http://localhost:5984/dbname")

  (clutch/watch-changes prod-db
                        :prod-print println
                        :include_docs true)

  (clutch/watch-changes dev-db
                        :dev-print println
                        :include_docs true)

  (clutch/changes-error prod-db :prod-print)

  (clutch/changes-error dev-db :dev-print)

Cheers, Dave.

@cemerick
Copy link
Contributor

Just to clarify, you say that watch-changes ran successfully — do you mean that that particular call succeeded, but your callback function (println in your examples) was never called?

Were there any stack traces, either on the Clojure or couchdb side?

@kzar
Copy link
Author

kzar commented Nov 22, 2011

Exactly, the watch-changes function returned successfully but println was not then called.

There where no stack trace or errors shown with changes-error and I can't see anything in couch.log.

@kzar
Copy link
Author

kzar commented Jan 16, 2012

I've just tested out the new version of clutch, watch-changes works again with a local database but I still can't get it working with a remote one. I guess there's a second bug somewhere :(

@cemerick cemerick reopened this Jan 26, 2012
@cemerick
Copy link
Contributor

Damn, you're right. Confirmed with Cloudant. The HTTP agent that sits on the _changes feed is disconnecting for some bizarre reason, but not when connected to localhost. :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants