finish writing data to database when computing the graph is finish