I often see "caught exception in func" in my logfile as well as in the console, but the program continues to run without any issues.
Today however, after "caught exception in func" line was printed in the console, nothing happened for a couple hours. Only a single line was printed, both in the console and in the log file. The program did not proceed but was running.
Then "caught exception in func" was printed again in the console and appended in the log file.
It seems the program is stuck in the func. But I am confused. If the API is throwing an error continuously, shouldn't the line "caught exception in func" be printing non-stop in the console as well in the file, rather than only once a couple of hours?
As one would expect the program is not proceeding beyond func. I could tell because, I have coded my positions to be squared of by 3:28 pm along with a print message that says "positions squared". This has not printed and I am still retaining the positions.
I continued to get "caught exception in func" after market hours.
It is not recommended to poll positions. You need to fetch it and cache it. It changes only when there is a partial fill of an order or when order executes.
while True: You are running a forever loop to fetch kite positions(nothing will proceed after this if a continuous exception is thrown ), which is strictly not recommended. If at all you need to re-fetch/pass(here) positions data(only after order changes), you should add a good amount of time delay.
It seems the program is stuck in the func. As one would expect the program is not proceeding beyond func.
while True:
You are running a forever loop to fetch kite positions(nothing will proceed after this if a continuous exception is thrown ), which is strictly not recommended. If at all you need to re-fetch/pass(here) positions data(only after order changes), you should add a good amount of time delay. Depends on how you call this
func()
.