Close the connection after writing file-info to db