Closed chiliec closed 6 years ago
It looks like a duplicate of #31, there is a bug in clj-http
that makes a call hang for an eternity.
In your code I recommend you to stop previous instance as well, you could be leaking memory with hanging threads.
(defn -main
[& args]
(println "Bot running!")
(go-loop [ch (p/start token bot-api)]
(<! (timeout 5000))
(if (nil? (<! ch))
(do
(println "Bot restarted")
(p/stop ch)
(recur (p/start token bot-api)))
(recur ch)))
(Thread/sleep Long/MAX_VALUE))
right? and what to do with this bug? 🤕
Yes, something like that! Hold on tight, I'm working on it ;)
Okay, thanks, we believe in you!
@Chiliec Just FYI, I've released 0.3.2
to Clojars that should fix this
Now just stopped after start:
Jan 25, 2018 2:29:20 PM morse.polling invoke
SEVERE: HTTP request timed out, stopping polling
It seems behavior changed and example usage in readme need to be updated?
@Chiliec oooops, found a stupid bug where I used seconds instead if milliseconds
pushed 0.3.3
to clojars, would you be so kind to try again?
If I set {timeout: 5000}
than request timed out going away, but now enters to infinite loop (many answers).
@Chiliec @Otann I think it's not about the timeout but about the offset which is passed to telegram API, mb this would help? https://github.com/Otann/morse/pull/34/files
@dixel thanks, it resolves my problem 👍
Released 0.3.4
Thanks!
We use this code:
but bot freezes sometimes for unknown reasons 🤔