I have a small app that uses core.async to run a function periodically. The code is here: https://github.com/tstout/fin-data/blob/main/src/fin_data/timers.clj Frequently the periodic execution stops. The function being executed pulls some data from my email inbox. The cessation of execution seems tied to my ISP having issues. The email polling function throws an exeception: Caused by: java.util.concurrent.ExecutionException: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: http://imap.gmail.com, 993; timeout -1; nested exception is: java.net.UnknownHostException at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122) This exception is caught and logged, and a recur is executed in the go loop. Is there something incorrect here regarding the usage of alt! ?
Not positive that this is the issue but it might be: you're doing IO in a go block. you should either wrap the f call like:
(
or just use a thread for the whole loopMaybe try catching Throwable instead of Exception. I see you're using :pre conditions and those don't throw Exceptions but AssertionErrors, so that's one thing that could be breaking the loop