Update blog.py

if the  global connection is close  or  exception  create the new one