Jul-05-2021, 08:58 AM
Hello,
I'm using Pool function to run several mysql command 'update'
I guess I have some connection problems because I'm gettig this error:
but why the try didn't catch the exception and continue ?
I'm using Pool function to run several mysql command 'update'
I guess I have some connection problems because I'm gettig this error:
mysql.connector.errors.OperationalError: MySQL Connection not available.maybe netwrok isuses or my sql server is down - I'm checking it now
but why the try didn't catch the exception and continue ?
try:
mycursor1 = mydb.cursor()
sql1 = f"update david.david_test set ROU_COMMENT = '" + Upload_Status + "',SendTime=NOW() where rou_ip = '" + Unit_IP + "';"
print(Upload_Status)
mycursor1.execute(sql1)
mydb.commit()
except mysql.connector.Error as err:
print("Something went wrong: {}".format(err))
except Exception as e:
print(e)
print('MYSQL Problem?')is it beacuse the Pool function is not also in try\except? if __name__ == '__main__':
StartTime = datetime.now()
Device_List = getListFromMysql()
Final_List = []
with Pool(10) as p:
Final_List = p.map(GetUplaudFies, Device_List)
Thanks,
