Facebook Open Graph from Rails Heroku

后端 未结 3 846
广开言路
广开言路 2021-02-06 11:13

I\'ve been fighting this problem all day, and could really need some input.

I have a Rails application (3.1.3) running on Heroku Cedar, trying to publish some Facebook O

相关标签:
3条回答
  • 2021-02-06 11:25

    Solved it!

    Really stupid actually. I had only one web dyno in my Heroku application. Since my only web dyno was doing the Facebook API call, there was no dyno to respond to the Facebook callback. You need at least 2 to get this to work.

    The reason the code worked in heroku console was simply because the web dyno was not busy handling my request.

    I might push that code to a work queue in the future as it seems more appropriate and let a worker dyno handle the Facebook publishing.

    0 讨论(0)
  • 2021-02-06 11:32

    An alternative to a second dyno might be to try Unicorn - that would allow your app to service the second call while the first is blocked.

    These articles give some useful detail on getting started with Unicorn:

    • More concurrency on a single Heroku dyno with the new Celadon Cedar stack
    • Unicorn!
    0 讨论(0)
  • 2021-02-06 11:39

    The following link seems to suggest this is timeout related, although no actual solution has yet been given. facebook "could not retrieve data from URL"

    You may want to also keep track of answers for the above link.

    0 讨论(0)
提交回复
热议问题