Code Monkey home page Code Monkey logo

Comments (9)

ztellman avatar ztellman commented on May 20, 2024
(def r (delay (redis-client ...)))

(@r [:get :foo])

should only connect when you make your first request. I think there's definitely value in having a :lazy-connect? option, though. Expect to see it in a future release.

from aleph.

dmix avatar dmix commented on May 20, 2024

Thanks Zach,

Tested out delaying the connection: dmix/documeds@2aca28b

But its still timing out on deploy. I've contacted Heroku, but its been almost 20hrs with no reply. So I imagine they dont have an easy answer either.

This may be more of a heroku problem than a Aleph, so I'll likely close this issue shortly unless I can think of some other ideas.

from aleph.

ztellman avatar ztellman commented on May 20, 2024

How is the timeout manifesting itself? I don't see a timeout on the Redis calls, this is just when it's connecting?

from aleph.

mpenet avatar mpenet commented on May 20, 2024

Could it be an issue with the options you pass to the client ?

From the names it seems you are using an URL instead of a hostname as a value for :host
https://github.com/dmix/documeds/blob/master/src/documeds/settings.clj#L4
https://github.com/dmix/documeds/blob/master/src/documeds/models/medication.clj#L19

from aleph.

dmix avatar dmix commented on May 20, 2024

Yeah I'd like to provide more details on where its timing out, but heroku/clojure isnt outputting anything. Here are the heroku logs https://gist.github.com/1842439

When I connect locally or to the remote repl ("heroku run lein run repl") and paste in the same aleph code, it works. So I imagine the credentials are fine. The url variable is indeed the RedisToGo host and not the full URL.

from aleph.

ztellman avatar ztellman commented on May 20, 2024

Okay, I see from your issue on the Heroku mailing list that it's never starting up the server. If you just

(def r nil)

does that boot up okay? If you've delayed the creation of the redis client, there's no way it should be interfering with the server starting up.

from aleph.

dmix avatar dmix commented on May 20, 2024

Yep, if I define (def r ()) it deploys fine.

from aleph.

ztellman avatar ztellman commented on May 20, 2024

Can you log when the redis-client is realized? Something like

(def r 
  (delay 
    (println "REALIZING...")
    (redis-client {:host redis-url :password redis-pass :port redis-port})))

You might even try (.printStackTrace (Exception.)) within the delay scope to tell you what's triggering it. The only way the empty value and delay block can differ in the behavior is if something's realizing the client before the server binds to the port.

from aleph.

dmix avatar dmix commented on May 20, 2024

Went for a coffee and came back,now its running fine in production. Tried redeploying and it worked again.

It's possible that a) delaying the process fixed the issue and it didn't deploy properly earlier or b) a heroku staffer fixed the issue and hasnt notified me yet.

Either way its fixed and I appreciate the help.

from aleph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.