@@ -673,18 +673,27 @@ def io_push(self, feed, data):
673673 wifi = adafruit_esp32spi_wifimanager .ESPSPI_WiFiManager (self ._esp , secrets , None )
674674 io_connect = RESTClient (aio_username , aio_key , wifi )
675675
676- try :
677- feed_id = io_connect .get_feed (feed )
678- except AdafruitIO_RequestError :
679- # If no feed exists, create one
680- feed_id = io_connect .create_new_feed (feed )
681- except RuntimeError as exception :
682- print ("Some error occured, retrying! -" , exception )
683-
684- try :
685- io_connect .send_data (feed_id ['key' ], data )
686- except RuntimeError as exception :
687- print ("Some error occured, retrying! -" , exception )
676+ while True :
677+ try :
678+ feed_id = io_connect .get_feed (feed )
679+ except AdafruitIO_RequestError :
680+ # If no feed exists, create one
681+ feed_id = io_connect .create_new_feed (feed )
682+ except RuntimeError as exception :
683+ print ("An error occured, retrying! 1 -" , exception )
684+ continue
685+ break
686+
687+ while True :
688+ try :
689+ io_connect .send_data (feed_id ['key' ], data )
690+ except RuntimeError as exception :
691+ print ("An error occured, retrying! 2 -" , exception )
692+ continue
693+ except NameError as exception :
694+ print (feed_id ['key' ], data , exception )
695+ continue
696+ break
688697
689698 def fetch (self , refresh_url = None ):
690699 """Fetch data from the url we initialized with, perfom any parsing,
0 commit comments